bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: test-utimens.h:105: assertion failed


From: Eric Blake
Subject: Re: test-utimens.h:105: assertion failed
Date: Wed, 04 Nov 2009 06:24:04 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

-----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             address@hidden
-----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 <address@hidden>
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 <address@hidden>
---
 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  <address@hidden>
+
+       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  <address@hidden>

        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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]