bug-coreutils
[Top][All Lists]
Advanced

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

Re: I: coreutils-20041123: src/touch.c regression


From: Jim Meyering
Subject: Re: I: coreutils-20041123: src/touch.c regression
Date: Mon, 03 Jan 2005 21:51:06 +0100

Paul Eggert <address@hidden> wrote:

> Jim Meyering <address@hidden> writes:
>
>> "Dmitry V. Levin" <address@hidden> wrote:
>>> +      if (errno != ENOSYS && errno != ENOENT)
>>
>> Thanks.
>> I've made that change.
>
> On further thought, this looks like a classic example where we should
> be testing for known valid error numbers rather than adding bogus
> error numbers as reports come in from the field.  So I installed this:

Either way is fine with me, as long as we get it right :-)
I have a slight preference for the approach that uses the smaller,
set of errno values, on the assumption that it's easier to
verify completeness.  Also, I suspect it is more likely that the
larger set will grow, in this case.

Your switch statement should probably handle EBADF, too,
to avoid an unnecessary utimes call after such a failure.

> 2005-01-03  Paul Eggert  <address@hidden>
>
>       * utimens.c (futimens): Robustify the previous patch, by checking
>       for known valid error numbers rather than observed invalid ones.
...
> +      switch (errno)
> +     {
> +     case EACCES:
> +     case EIO:
> +     case EPERM:
> +     case EROFS:
> +       return -1;
> +     }
>      }
>  # endif
>    return utimes (file, t);




reply via email to

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