Blob Blame History Raw
diff -urNp coreutils-7.5-orig/src/copy.c coreutils-7.5/src/copy.c
--- coreutils-7.5-orig/src/copy.c
+++ coreutils-7.5/src/copy.c
@@ -124,7 +124,13 @@ static inline int
 utimens_symlink (char const *file, struct timespec const *timespec)
 {
 #if HAVE_UTIMENSAT
-  return utimensat (AT_FDCWD, file, timespec, AT_SYMLINK_NOFOLLOW);
+  int 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;
+  return err;
 #else
   /* Don't set errno=ENOTSUP here as we don't want
      to output an error message for this case.  */