Move to u16-mbtouc-unsafe.
[gnulib.git] / lib / utimens.c
index e72b840..71bc510 100644 (file)
@@ -1,6 +1,7 @@
 /* Set file access and modification times.
 
-   Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005, 2006, 2007 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
@@ -26,6 +27,7 @@
 
 #include <errno.h>
 #include <fcntl.h>
+#include <sys/time.h>
 #include <unistd.h>
 
 #if HAVE_UTIME_H
@@ -87,10 +89,10 @@ futimens (int fd ATTRIBUTE_UNUSED,
      problem affects many applications.  */
 
 #if HAVE_BUGGY_NFS_TIME_STAMPS
-  if (0 <= fd)
-    fsync (fd);
-  else
+  if (fd < 0)
     sync ();
+  else
+    fsync (fd);
 #endif
 
   /* There's currently no interface to set file timestamps with