-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Eric Blake on 10/30/2009 6:53 AM: >> I can't reproduce on current debian testing, so it is likely an old bug. > > The Linux man pages are explicit that older kernels had a bug where > UTIME_OMIT with a non-zero seconds field failed with EINVAL instead of > working, but I thought my code path already worked around this.
Nope - it turns out my code worked around it for utimensat, but not futimens. Fixed as follows (and I feel embarrassed for overlooking this when I first implemented the workaround in commit 080cbfc). - -- Don't work too hard, make some time for fun as well! Eric Blake e...@byu.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkrxgHQACgkQ84KuGfSFAYBnywCgpby0cdlYDvGKmLPjeZJsm0qB ZmoAoLJrQamnS8HKNt8RoszPc1StGn5c =1uM4 -----END PGP SIGNATURE-----
>From 6666c24469f930bf1442a6d24b499fdfab8b999d Mon Sep 17 00:00:00 2001 From: Eric Blake <e...@byu.net> Date: Wed, 4 Nov 2009 06:19:23 -0700 Subject: [PATCH] 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 <e...@byu.net> --- ChangeLog | 7 +++++++ lib/utimens.c | 2 +- 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index dbdcf81..7c99b19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-11-04 Eric Blake <e...@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-10-30 Eric Blake <e...@byu.net> vasnprintf: avoid compiler warnings diff --git a/lib/utimens.c b/lib/utimens.c index ffc60b6..ce759a1 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) -- 1.6.5.rc1