diff --git a/src/chcon.c b/src/chcon.c index a54133a5c..f118820cc 100644 --- a/src/chcon.c +++ b/src/chcon.c @@ -245,7 +245,7 @@ process_file (FTS *fts, FTSENT *ent) accessible when control reaches this point. So, if this is the first time we've seen the FTS_NS for this file, tell fts_read to stat it "again". */ - if (ent->fts_level == 0 && ent->fts_number == 0) + if (ent->fts_level == FTS_ROOTLEVEL && ent->fts_number == 0) { ent->fts_number = 1; fts_set (fts, ent, FTS_AGAIN); diff --git a/src/chmod.c b/src/chmod.c index 1e1cc4cd5..e38fdbd2b 100644 --- a/src/chmod.c +++ b/src/chmod.c @@ -229,7 +229,7 @@ process_file (FTS *fts, FTSENT *ent) accessible when control reaches this point. So, if this is the first time we've seen the FTS_NS for this file, tell fts_read to stat it "again". */ - if (ent->fts_level == 0 && ent->fts_number == 0) + if (ent->fts_level == FTS_ROOTLEVEL && ent->fts_number == 0) { ent->fts_number = 1; fts_set (fts, ent, FTS_AGAIN); @@ -308,7 +308,7 @@ process_file (FTS *fts, FTSENT *ent) umask_value, change, nullptr); bool follow_symlink = !!dereference; if (dereference == -1) /* -H with/without -R, -P without -R. */ - follow_symlink = ent->fts_level == 0; + follow_symlink = ent->fts_level == FTS_ROOTLEVEL; if (fchmodat (fts->fts_cwd_fd, file, ch.new_mode, follow_symlink ? 0 : AT_SYMLINK_NOFOLLOW) == 0) ch.status = CH_SUCCEEDED; diff --git a/src/chown-core.c b/src/chown-core.c index 0e08f93e6..55d1cf718 100644 --- a/src/chown-core.c +++ b/src/chown-core.c @@ -327,7 +327,7 @@ change_file_owner (FTS *fts, FTSENT *ent, accessible when control reaches this point. So, if this is the first time we've seen the FTS_NS for this file, tell fts_read to stat it "again". */ - if (ent->fts_level == 0 && ent->fts_number == 0) + if (ent->fts_level == FTS_ROOTLEVEL && ent->fts_number == 0) { ent->fts_number = 1; fts_set (fts, ent, FTS_AGAIN);