unistr/u8-chr, unistr/u8-strchr: Optimize and add comments.
[pspp] / lib / utimens.c
index b3a9a4a5fef99795253ba0d62c289b389db4bfc1..35d082de568a0894f25e1573970621f00d899ad6 100644 (file)
@@ -1,6 +1,6 @@
 /* Set file access and modification times.
 
-   Copyright (C) 2003-2009 Free Software Foundation, Inc.
+   Copyright (C) 2003-2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
@@ -264,19 +264,20 @@ fdutimens (char const *file, int fd, struct timespec const timespec[2])
         }
 # endif /* HAVE_UTIMENSAT */
 # if HAVE_FUTIMENS
-      {
-        result = futimens (fd, ts);
+      if (0 <= fd)
+        {
+          result = futimens (fd, ts);
 #  ifdef __linux__
-        /* Work around the same bug as above.  */
-        if (0 < result)
-          errno = ENOSYS;
+          /* Work around the same bug as above.  */
+          if (0 < result)
+            errno = ENOSYS;
 #  endif /* __linux__ */
-        if (result == 0 || errno != ENOSYS)
-          {
-            utimensat_works_really = 1;
-            return result;
-          }
-      }
+          if (result == 0 || errno != ENOSYS)
+            {
+              utimensat_works_really = 1;
+              return result;
+            }
+        }
 # endif /* HAVE_FUTIMENS */
     }
   utimensat_works_really = -1;
@@ -299,7 +300,7 @@ fdutimens (char const *file, int fd, struct timespec const timespec[2])
   {
 #if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES
     struct timeval timeval[2];
-    struct timeval const *t;
+    struct timeval *t;
     if (ts)
       {
         timeval[0].tv_sec = ts[0].tv_sec;
@@ -483,7 +484,7 @@ lutimens (char const *file, struct timespec const timespec[2])
 #if HAVE_LUTIMES && !HAVE_UTIMENSAT
   {
     struct timeval timeval[2];
-    struct timeval const *t;
+    struct timeval *t;
     int result;
     if (ts)
       {