Ondrej Vasik 5fd0b0
diff -urNp coreutils-7.5-orig/src/copy.c coreutils-7.5/src/copy.c
Ondrej Vasik 5fd0b0
--- coreutils-7.5-orig/src/copy.c
Ondrej Vasik 5fd0b0
+++ coreutils-7.5/src/copy.c
Ondrej Vasik 5fd0b0
@@ -124,7 +124,13 @@ static inline int
Ondrej Vasik 5fd0b0
 utimens_symlink (char const *file, struct timespec const *timespec)
Ondrej Vasik 5fd0b0
 {
Ondrej Vasik 5fd0b0
 #if HAVE_UTIMENSAT
Ondrej Vasik 5fd0b0
-  return utimensat (AT_FDCWD, file, timespec, AT_SYMLINK_NOFOLLOW);
Ondrej Vasik 5fd0b0
+  int err = utimensat (AT_FDCWD, file, timespec, AT_SYMLINK_NOFOLLOW);
Ondrej Vasik 5fd0b0
+  /* When configuring on a system with new headers and libraries, and
Ondrej Vasik 5fd0b0
+     running on one with a kernel that is old enough to lack the syscall,
Ondrej Vasik 5fd0b0
+     utimensat fails with ENOTSUP.  Ignore that.  */
Ondrej Vasik 5fd0b0
+  if (err && errno == ENOSYS)
Ondrej Vasik 5fd0b0
+    err = 0;
Ondrej Vasik 5fd0b0
+  return err;
Ondrej Vasik 5fd0b0
 #else
Ondrej Vasik 5fd0b0
   /* Don't set errno=ENOTSUP here as we don't want
Ondrej Vasik 5fd0b0
      to output an error message for this case.  */