Only call chflags() on directories once.

Approved by:	ru
MFC after:	1 week
This commit is contained in:
ceri 2004-02-18 18:45:11 +00:00
parent 8c2ff6c3d5
commit 6730a7920d

View File

@ -132,11 +132,10 @@ main(int argc, char *argv[])
for (rval = 0; (p = fts_read(ftsp)) != NULL;) {
switch (p->fts_info) {
case FTS_D:
if (Rflag) /* Change it at FTS_DP. */
continue;
fts_set(ftsp, p, FTS_SKIP);
break;
case FTS_D: /* Change it at FTS_DP if we're recursive. */
if (!Rflag)
fts_set(ftsp, p, FTS_SKIP);
continue;
case FTS_DNR: /* Warn, chflag, continue. */
warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
rval = 1;