mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
cp: ignore obscure failure to preserve symlink time stamps,
...when run on a kernel older than what was implied by headers and libraries tested at configure time. * src/copy.c (utimens_symlink): Ignore failure when errno == ENOSYS. * NEWS (Bug fixes): Mention it. Reported by Todd Zullinger and Kamil Dudka. Details in this thread: http://thread.gmane.org/gmane.linux.redhat.fedora.devel/119834
This commit is contained in:
1 parent
831acb987e
commit
2bc0f3caaa
2 files changed
+16
-5
No files matched your search
+10
-5
@@ -123,13 +123,18 @@ 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
|
||||
return utimensat (AT_FDCWD, file, timespec, AT_SYMLINK_NOFOLLOW);
|
||||
#else
|
||||
/* Don't set errno=ENOTSUP here as we don't want
|
||||
to output an error message for this case. */
|
||||
return 0;
|
||||
err = utimensat (AT_FDCWD, file, timespec, AT_SYMLINK_NOFOLLOW);
|
||||
/* 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;
|
||||
#endif
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Perform the O(1) btrfs clone operation, if possible.
|
||||
|
||||
Reference in new issue
Block a user