diff options
author | Eric Blake <ebb9@byu.net> | 2009-10-08 15:57:06 -0600 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2009-10-10 15:16:52 -0600 |
commit | 7280a913a12ebfe33e8cad1b217b84944bbd3681 (patch) | |
tree | e5492e485e56314c073cff40b99b34c3ea88a305 /src | |
parent | 7ff00ca82f134880b2aa751de96756b46a895ae1 (diff) | |
download | coreutils-7280a913a12ebfe33e8cad1b217b84944bbd3681.tar.xz |
copy: allow symlink timestamp preservation on more systems
* src/copy.c (utimens_symlink): Simplify by using lutimens.
* m4/jm-macros.m4 (coreutils_MACROS): Drop utimensat; gnulib does
this for us.
* tests/cp/preserve-slink-time: Recognize lutimes support.
Diffstat (limited to 'src')
-rw-r--r-- | src/copy.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/copy.c b/src/copy.c index 49e620afd..0a8b0e41d 100644 --- a/src/copy.c +++ b/src/copy.c @@ -123,20 +123,12 @@ static char const *top_level_dst_name; static inline int utimens_symlink (char const *file, struct timespec const *timespec) { - int err = 0; - -#if HAVE_UTIMENSAT - err = utimensat (AT_FDCWD, file, timespec, AT_SYMLINK_NOFOLLOW); + int err = lutimens (file, timespec); /* When configuring on a system with new headers and libraries, and running on one with a kernel that is old enough to lack the syscall, utimensat fails with ENOSYS. Ignore that. */ if (err && errno == ENOSYS) err = 0; -#else - (void) file; - (void) timespec; -#endif - return err; } |