fts: do not fail on a submount during traversal
[pspp] / lib / utimens.c
index ffc60b699a68e014ffb1fa12e5596e971ec512af..bd482d7d01a48f0113801a8dc89d8c6eefe43007 100644 (file)
@@ -227,7 +227,7 @@ fdutimens (char const *file, int fd, struct timespec const timespec[2])
 # endif /* HAVE_UTIMENSAT */
 # if HAVE_FUTIMENS
       {
-        int result = futimens (fd, timespec);
+        int result = futimens (fd, ts);
 #  ifdef __linux__
         /* Work around the same bug as above.  */
         if (0 < result)
@@ -280,9 +280,9 @@ fdutimens (char const *file, int fd, struct timespec const timespec[2])
       }
     else
       {
-        /* If futimesat or futimes fails here, don't try to speed things
-           up by returning right away.  glibc can incorrectly fail with
-           errno == ENOENT if /proc isn't mounted.  Also, Mandrake 10.0
+        /* If futimesat (above) or futimes fails here, don't try to speed
+           things up by returning right away.  glibc can incorrectly fail
+           with errno == ENOENT if /proc isn't mounted.  Also, Mandrake 10.0
            in high security mode doesn't allow ordinary users to read
            /proc/self, so glibc incorrectly fails with errno == EACCES.
            If errno == EIO, EPERM, or EROFS, it's probably safe to fail
@@ -290,10 +290,7 @@ fdutimens (char const *file, int fd, struct timespec const timespec[2])
            worth optimizing, and who knows what other messed-up systems
            are out there?  So play it safe and fall back on the code
            below.  */
-# if HAVE_FUTIMESAT
-        if (futimesat (fd, NULL, t) == 0)
-          return 0;
-# elif HAVE_FUTIMES
+# if HAVE_FUTIMES
         if (futimes (fd, t) == 0)
           return 0;
 # endif