update debian/copyright
[gnulib.git] / lib / utimensat.c
index 5a55e64..37f0ea8 100644 (file)
@@ -84,6 +84,21 @@ rpl_utimensat (int fd, char const *file, struct timespec const times[2],
             ts[1] = times[1];
           times = ts;
         }
+#  ifdef __hppa__
+      /* Linux kernel 2.6.22.19 on hppa does not reject invalid tv_nsec
+         values.  */
+      else if (times
+               && ((times[0].tv_nsec != UTIME_NOW
+                    && (times[0].tv_nsec < 0
+                        || times[0].tv_nsec >= 1000000000))
+                   || (times[1].tv_nsec != UTIME_NOW
+                       && (times[1].tv_nsec < 0
+                           || times[1].tv_nsec >= 1000000000))))
+        {
+          errno = EINVAL;
+          return -1;
+        }
+#  endif
 # endif /* __linux__ */
       result = utimensat (fd, file, times, flag);
       /* Linux kernel 2.6.25 has a bug where it returns EINVAL for