Eric Blake wrote:
> On 10/11/2010 04:51 AM, Jim Meyering wrote:
>> That's because futimens (AT_FDCWD, NULL) would fail with errno set to
>> EFAULT, rather than the expected value of EBADF.
>>
>> At first I was going to relax the test to allow "|| errno == EFAULT",
>> but what if EFAULT is not defined?  There's only one other use in gnulib.
>
> I agree that we should not relax things for EFAULT.
>
>> +++ b/tests/test-futimens.h
>> @@ -75,7 +75,7 @@ test_futimens (int (*func) (int, struct timespec const *),
>>
>>     /* Invalid arguments.  */
>>     errno = 0;
>> -  ASSERT (func (AT_FDCWD, NULL) == -1);
>> +  ASSERT (func (-1, NULL) == -1);
>
> However, I disagree with this change.  The whole point of testing
> AT_FDCWD is that it IS an invalid fd, and implementations must reject
> it in a sane manner.  Solaris 5.11 has a bug, and we need to enhance
> the .m4 test to reject this bug and improve our futimens wrapper to
> work around it.  We already worked around this bug for glibc 2.11
> (thankfully, it has been fixed for current glibc).

That makes sense.  You're welcome to revert this once the .m4
and wrapper machinery renders it unnecessary.

Reply via email to