On 09/16/10 16:28, Eric Blake wrote:
>  int
> -fdutimensat (int dir, char const *file, int fd, struct timespec const ts[2])
> +fdutimensat (int dir, char const *file, int fd, struct timespec const ts[2],
> +             int atflag)
>  {
>    int result = 1;
> +  if (atflag & ~AT_SYMLINK_NOFOLLOW)
> +    {
> +      errno = EINVAL;
> +      return -1;
> +    }
>    if (0 <= fd)
> -    result = futimens (fd, ts);
> +    {
> +      if (atflag)
> +        {
> +          errno = EINVAL;
> +          return -1;
> +        }
> +      result = futimens (fd, ts);
> +    }

Thanks, but unfortunately this doesn't look quite right for GNU tar's purposes.
Tar specifies a nonnegative FD along with a flag equal to AT_SYMLINK_NOFOLLOW.
The idea is that if the underlying system doesn't support futimens
for some reason, tar can still fall back on utimensat, and know
that utimensat won't follow the symlink.

I don't know whether there is any actual system where utimensat works
but futimens doesn't, but I'm pretty sure there is such a problem with
chmod/chown/etc. and I wouldn't be surprised if the problem also existed
with futimens.

If you like, I can install the obvious patch.

Reply via email to