changeset 15525:792927a7e09d

maint: fts.c: move __opendir2 #define "up" out of function body * lib/fts.c (__opendir2): Move "up". No semantic change.
author Jim Meyering <meyering@redhat.com>
date Tue, 16 Aug 2011 20:11:51 +0200
parents f69f605f31b4
children 95cf436ab3b8
files ChangeLog lib/fts.c
diffstat 2 files changed, 16 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Aug 16 20:08:24 2011 +0200
+++ b/ChangeLog	Tue Aug 16 20:11:51 2011 +0200
@@ -1,5 +1,8 @@
 2011-08-19  Jim Meyering  <meyering@redhat.com>
 
+	maint: fts.c: move __opendir2 #define "up" out of function body
+	* lib/fts.c (__opendir2): Move "up".  No semantic change.
+
 	maint: fts.c: remove #if-0'd FTS_WHITEOUT code
 	* lib/fts.c: Remove #if-0'd FTS_WHITEOUT code.  It's been #if-0'd
 	out for a long time and besides was useful only on BSD systems.
--- a/lib/fts.c	Tue Aug 16 20:08:24 2011 +0200
+++ b/lib/fts.c	Tue Aug 16 20:11:51 2011 +0200
@@ -1192,6 +1192,17 @@
   st->st_mode = type;
 }
 
+# define __opendir2(file, flag) \
+        opendirat((! ISSET(FTS_NOCHDIR) && ISSET(FTS_CWDFD)     \
+                   ? sp->fts_cwd_fd : AT_FDCWD),                \
+                  file,                                         \
+                  (((ISSET(FTS_PHYSICAL)                        \
+                     && ! (ISSET(FTS_COMFOLLOW)                 \
+                           && cur->fts_level == FTS_ROOTLEVEL)) \
+                    ? O_NOFOLLOW : 0)                           \
+                   | (ISSET (FTS_NOATIME) ? O_NOATIME : 0)),    \
+                  &dir_fd)
+
 /*
  * This is the tricky part -- do not casually change *anything* in here.  The
  * idea is to build the linked list of entries that are used by fts_children
@@ -1229,21 +1240,8 @@
         /* Set current node pointer. */
         cur = sp->fts_cur;
 
-        /*
-         * Open the directory for reading.  If this fails, we're done.
-         * If being called from fts_read, set the fts_info field.
-         */
-# define __opendir2(file, flag) \
-        opendirat((! ISSET(FTS_NOCHDIR) && ISSET(FTS_CWDFD)     \
-                   ? sp->fts_cwd_fd : AT_FDCWD),                \
-                  file,                                         \
-                  (((ISSET(FTS_PHYSICAL)                        \
-                     && ! (ISSET(FTS_COMFOLLOW)                 \
-                           && cur->fts_level == FTS_ROOTLEVEL)) \
-                    ? O_NOFOLLOW : 0)                           \
-                   | (ISSET (FTS_NOATIME) ? O_NOATIME : 0)),    \
-                  &dir_fd)
-
+        /* Open the directory for reading.  If this fails, we're done.
+           If being called from fts_read, set the fts_info field.  */
        if ((dirp = __opendir2(cur->fts_accpath, oflag)) == NULL) {
                 if (type == BREAD) {
                         cur->fts_info = FTS_DNR;