[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug 552320] Handling AT_FDCWD as EBADF in glibc's utimens() causes
From: |
Eric Blake |
Subject: |
Re: [Bug 552320] Handling AT_FDCWD as EBADF in glibc's utimens() causes tar failures |
Date: |
Tue, 05 Jan 2010 20:15:31 -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 |
According to Jim Meyering on 1/5/2010 2:07 PM:
>> https://bugzilla.redhat.com/show_bug.cgi?id=552320
> Thanks for the heads up. Good timing.
> That does indeed look like a bug, and Aurelien Jarno's fix seems right.
I can confirm that the fix is correct.
>
> I expect to push the following to gnulib in the morning:
>
>>From e7d83f123f5eed312523252c066510b5de0f7cd1 Mon Sep 17 00:00:00 2001
> From: Aurelien Jarno <address@hidden>
> Date: Tue, 5 Jan 2010 21:31:41 +0100
> Subject: [PATCH] utimens (fdutimens): ignore a negative FD, per contract
>
> * lib/utimens.c (fdutimens) [HAVE_FUTIMENS]: Call futimens only
> when we have a valid file descriptor. Otherwise, using a brand
> new glibc (with just-patched futimes that now fails with EBADF)
s/futimes/futimens/ (ChangeLog and commit message)
> +++ b/lib/utimens.c
> @@ -264,19 +264,20 @@ fdutimens (char const *file, int fd, struct timespec
> const timespec[2])
> }
> # endif /* HAVE_UTIMENSAT */
> # if HAVE_FUTIMENS
> - {
> - result = futimens (fd, ts);
> + if (0 <= fd)
> + {
Why the TAB? We just got rid of those in gnulib.
--
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
signature.asc
Description: OpenPGP digital signature