utimens: work around older Linux failure with symlinks
authorEric Blake <ebb9@byu.net>
Tue, 24 Nov 2009 17:07:57 +0000 (10:07 -0700)
committerEric Blake <ebb9@byu.net>
Wed, 25 Nov 2009 13:36:37 +0000 (06:36 -0700)
commit0457832f3edc43cfec9edbc14aef7e4e3dee9c83
treeca69056b2a0eb9771740344eef588de16c55747c
parent63a3cbb6f49f24e17ca914064b39677110c79ca8
utimens: work around older Linux failure with symlinks

Some Linux kernel versions support utimensat(,0) but not
utimensat(,AT_SYMLINK_NOFOLLOW), even for non-symlinks.  Had the
fallback code for regular files been reached, it would have truncated
timestamps.  But since glibc lutimes just wraps utimensat, and we
didn't expect ENOSYS from lutimes, the fallback wasn't even reached.

* lib/utimens.c (lutimensat_works_really): New variable.
(fdutimens, lutimens): Use it to manage kernels that support
nanosecond times on files, but not on symlinks.
Reported by Ondřej Vašík.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/utimens.c