utimens: let lutimens work on non-symlinks
authorEric Blake <ebb9@byu.net>
Thu, 15 Oct 2009 18:04:57 +0000 (12:04 -0600)
committerEric Blake <ebb9@byu.net>
Fri, 16 Oct 2009 14:26:12 +0000 (08:26 -0600)
commit0c278290674f9bb9749d27f2885da510a78acc79
treef2e2316206343801f0485ac8268b9b05148f51e7
parentc1572a883111051641846698f7b5a7e590206c5d
utimens: let lutimens work on non-symlinks

Coreutils new 'touch -h' is easier to write if we guarantee POSIX
semantics of utimensat(fd,"file",NULL,AT_SYMLINK_NOFOLLOW), rather
than blindly failing with ENOSYS even on non-symlinks.

* lib/utimens.c (lutimens): Fall back to utimens rather than
failing with ENOSYS, when file is not a symlink.
(utimens): Reduce redirection.
* tests/test-lutimens.h (test_lutimens): Update test to cover
non-symlinks.
* tests/test-utimens.h (test_utimens): Update test to cover
symlinks.
* tests/test-utimens.c (main): Update caller.

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