utimens: fix use of futimens on older Linux
authorEric Blake <ebb9@byu.net>
Wed, 4 Nov 2009 13:19:23 +0000 (06:19 -0700)
committerEric Blake <ebb9@byu.net>
Wed, 4 Nov 2009 13:24:54 +0000 (06:24 -0700)
Using UTIME_OMIT with non-zero seconds was already worked around
for utimensat, but I missed the futimens case.

* lib/utimens.c (fdutimens): Use updated, rather than original,
timespec to avoid bug in older Linux kernel.
Reported by Simon Josefsson.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/utimens.c

index 58635bd..57a7fdb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-11-04  Eric Blake  <ebb9@byu.net>
+
+       utimens: fix use of futimens on older Linux
+       * lib/utimens.c (fdutimens): Use updated, rather than original,
+       timespec to avoid bug in older Linux kernel.
+       Reported by Simon Josefsson.
+
 2009-11-04  Bruno Haible  <bruno@clisp.org>
 
        Make num_processors more flexible and consistent.
index ffc60b6..ce759a1 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)