]> git.cworth.org Git - tar/blobdiff - m4/utimes.m4
Imported Upstream version 1.23
[tar] / m4 / utimes.m4
index 5b010acd8b3192191fb6491b2c519837cefd0b44..e6d6f776499329fe76839f655ad97b1378320406 100644 (file)
@@ -1,6 +1,7 @@
 # Detect some bugs in glibc's implementation of utimes.
+# serial 2
 
-dnl Copyright (C) 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2005, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -19,8 +20,8 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_UTIMES],
 [
-  AC_CACHE_CHECK([determine whether the utimes function works],
-                gl_cv_func_working_utimes,
+  AC_CACHE_CHECK([whether the utimes function works],
+                 [gl_cv_func_working_utimes],
   [
   AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <sys/types.h>
@@ -44,11 +45,11 @@ main ()
   int fd;
 
   int ok = ((f = fopen (file, "w"))
-           && fclose (f) == 0
-           && utimes (file, timeval) == 0
-           && lstat (file, &sbuf) == 0
-           && sbuf.st_atime == timeval[0].tv_sec
-           && sbuf.st_mtime == timeval[1].tv_sec);
+            && fclose (f) == 0
+            && utimes (file, timeval) == 0
+            && lstat (file, &sbuf) == 0
+            && sbuf.st_atime == timeval[0].tv_sec
+            && sbuf.st_mtime == timeval[1].tv_sec);
   unlink (file);
   if (!ok)
     exit (1);
@@ -66,8 +67,8 @@ main ()
     exit (1);
 
   ok = (0 <= (fd = open (file, O_WRONLY|O_CREAT, 0444))
-             && close (fd) == 0
-             && utimes (file, NULL) == 0);
+              && close (fd) == 0
+              && utimes (file, NULL) == 0);
   unlink (file);
 
   exit (!ok);