Only call chflags() on directories once.
Approved by: ru MFC after: 1 week
This commit is contained in:
parent
097c5e8da4
commit
3004d1ed4d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125972
@ -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