summaryrefslogtreecommitdiff
path: root/m4/utimes-null.m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-04-24 07:40:00 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-04-24 07:40:00 +0000
commit779532f5567bf44c5e7eb4742fea7de80d1f7719 (patch)
tree4845339878bafc15803aaafa7ba50293e5637280 /m4/utimes-null.m4
parent79aba863ce1e9ce1bb8d7e852204806689f71a7c (diff)
downloadcoreutils-779532f5567bf44c5e7eb4742fea7de80d1f7719.tar.xz
Don't assume that 'exit' is declared for us.
Don't assume that you can exit with status -1. (import from gnulib)
Diffstat (limited to 'm4/utimes-null.m4')
-rw-r--r--m4/utimes-null.m420
1 files changed, 12 insertions, 8 deletions
diff --git a/m4/utimes-null.m4 b/m4/utimes-null.m4
index 927b877dd..8d5c8aef7 100644
--- a/m4/utimes-null.m4
+++ b/m4/utimes-null.m4
@@ -1,6 +1,8 @@
-#serial 6
+#serial 7
+
+# Copyright (C) 1998, 1999, 2001, 2003, 2004, 2006 Free Software
+# Foundation, Inc.
-# Copyright (C) 1998, 1999, 2001, 2003, 2004 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -16,13 +18,15 @@ AC_TRY_RUN([
#undef stat
#include <sys/types.h>
#include <sys/stat.h>
-main() {
+#include <sys/time.h>
+int
+main () {
struct stat s, t;
-exit(!(stat ("conftest.data", &s) == 0
- && utimes("conftest.data", (long *)0) == 0
- && stat("conftest.data", &t) == 0
- && t.st_mtime >= s.st_mtime
- && t.st_mtime - s.st_mtime < 120));
+return ! (stat ("conftest.data", &s) == 0
+ && utimes ("conftest.data", 0) == 0
+ && stat ("conftest.data", &t) == 0
+ && t.st_mtime >= s.st_mtime
+ && t.st_mtime - s.st_mtime < 120));
}],
ac_cv_func_utimes_null=yes,
ac_cv_func_utimes_null=no,