* src/chcon.c (process_file): Use FTS_ROOTLEVEL instead of 0.
* src/chmod.c (process_file): Likewise.
* src/chown-core.c (change_file_owner): Likewise.
---
 src/chcon.c      | 2 +-
 src/chmod.c      | 4 ++--
 src/chown-core.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

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);
-- 
2.51.0


Reply via email to