Only call chflags() on directories once.
Approved by: ru MFC after: 1 week
This commit is contained in:
parent
8c2ff6c3d5
commit
6730a7920d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user