Ignore the -w flag for partial compataibility with FreeBSD. Background: On FreeBSD, lookup failures for uname or gname generate fatal errors. The -w flag converts those errors into warnings and does not print the [gu]name key. The implementation is slightly wrong in that a directory containing a mix of files with a single resolvable username and files with unresolvable names gets an incorrect /set statment. On NetBSD name resolution failures result in [gu]id keys being printed. This seems much better since it does not risk a change of ownership. Index: mtree.8 =================================================================== --- mtree.8 (revision 240750) +++ mtree.8 (revision 240751) @@ -295,6 +295,9 @@ Exit with a status of 0 on success, 2 if the file hierarchy did not match the specification, and 1 if any other error occurred. +.It Fl w +Ignored for compatibility with FreeBSD versions of +.Nm . .It Fl W Don't attempt to set various file attributes such as the ownership, mode, flags, or time Index: mtree.c =================================================================== --- mtree.c (revision 240750) +++ mtree.c (revision 240751) @@ -77,7 +77,7 @@ init_excludes(); while ((ch = getopt(argc, argv, - "cCdDeE:f:I:ik:K:lLmMnN:p:PqrR:s:StuUWxX:")) + "cCdDeE:f:I:ik:K:lLmMnN:p:PqrR:s:StuUwWxX:")) != -1) { switch((char)ch) { case 'c': @@ -177,6 +177,9 @@ case 'U': Uflag = uflag = 1; break; + case 'w': + /* Ignored for compatibility with FreeBSD's mtree. */ + break; case 'W': mtree_Wflag = 1; break;