From: Eric Blake Date: Wed, 4 Nov 2009 13:19:23 +0000 (-0700) Subject: utimens: fix use of futimens on older Linux X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba79e984f96e1470e583cc1731b2f80da9de9afc;p=pspp utimens: fix use of futimens on older Linux 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 --- diff --git a/ChangeLog b/ChangeLog index 58635bdaa5..57a7fdb32b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-11-04 Eric Blake + + 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 Make num_processors more flexible and consistent. diff --git a/lib/utimens.c b/lib/utimens.c index ffc60b699a..ce759a1d09 100644 --- a/lib/utimens.c +++ b/lib/utimens.c @@ -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)