Split off gc-random from gc, and only warn on missing devices.
[gnulib.git] / m4 / utimes-null.m4
1 #serial 6
2
3 # Copyright (C) 1998, 1999, 2001, 2003, 2004 Free Software Foundation, Inc.
4 # This file is free software; the Free Software Foundation
5 # gives unlimited permission to copy and/or distribute it,
6 # with or without modifications, as long as this notice is preserved.
7
8 dnl Shamelessly cloned from acspecific.m4's AC_FUNC_UTIME_NULL,
9 dnl then do case-insensitive s/utime/utimes/.
10
11 AC_DEFUN([gl_FUNC_UTIMES_NULL],
12 [AC_CACHE_CHECK(whether utimes accepts a null argument, ac_cv_func_utimes_null,
13 [rm -f conftest.data; > conftest.data
14 AC_TRY_RUN([
15 /* In case stat has been defined to rpl_stat, undef it here.  */
16 #undef stat
17 #include <sys/types.h>
18 #include <sys/stat.h>
19 main() {
20 struct stat s, t;
21 exit(!(stat ("conftest.data", &s) == 0
22        && utimes("conftest.data", (long *)0) == 0
23        && stat("conftest.data", &t) == 0
24        && t.st_mtime >= s.st_mtime
25        && t.st_mtime - s.st_mtime < 120));
26 }],
27   ac_cv_func_utimes_null=yes,
28   ac_cv_func_utimes_null=no,
29   ac_cv_func_utimes_null=no)
30 rm -f core core.* *.core])
31
32     if test $ac_cv_func_utimes_null = yes; then
33       AC_DEFINE(HAVE_UTIMES_NULL, 1,
34                 [Define if utimes accepts a null argument])
35     fi
36   ]
37 )