New module 'unicase/ulc-casecoll'.
[pspp] / lib / utimens.c
index 134310b1c262aa18740c67f4b68bf9bcdb51539d..708de10989d1e703250a841d397cb2b736c5c2f4 100644 (file)
@@ -103,6 +103,18 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
   if (fd < 0)
     {
       int result = utimensat (AT_FDCWD, file, timespec, 0);
+# ifdef __linux__
+      /* Work around what might be a kernel bug:
+         http://bugzilla.redhat.com/442352
+         http://bugzilla.redhat.com/449910
+         It appears that utimensat can mistakenly return 280 rather
+         than -1 upon failure.
+         FIXME: remove in 2010 or whenever the offending kernels
+         are no longer in common use.  */
+      if (0 < result)
+        errno = ENOSYS;
+# endif
+
       if (result == 0 || errno != ENOSYS)
         return result;
     }
@@ -110,6 +122,11 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
 #if HAVE_FUTIMENS
   {
     int result = futimens (fd, timespec);
+# ifdef __linux__
+    /* Work around the same bug as above.  */
+    if (0 < result)
+      errno = ENOSYS;
+# endif
     if (result == 0 || errno != ENOSYS)
       return result;
   }