stat-time-tests: minor cleanups
authorEric Blake <ebb9@byu.net>
Mon, 12 Oct 2009 16:37:48 +0000 (10:37 -0600)
committerEric Blake <ebb9@byu.net>
Tue, 13 Oct 2009 02:57:13 +0000 (20:57 -0600)
* modules/stat-time-tests (configure.ac): Use AC_CHECK_FUNCS_ONCE.
* tests/test-stat-time.c (nap): Separate assignment from call.
Suggested by Paolo Bonzini and Bruno Haible.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
modules/stat-time-tests
tests/test-stat-time.c

index 1768d740dfe59bcbcafd30a4a87cf4c2feba8f2c..3c1077b4df1e2d13803b807f9a079d0ae6c0e49f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-10-12  Eric Blake  <ebb9@byu.net>
 
+       stat-time-tests: minor cleanups
+       * modules/stat-time-tests (configure.ac): Use AC_CHECK_FUNCS_ONCE.
+       * tests/test-stat-time.c (nap): Separate assignment from call.
+       Suggested by Paolo Bonzini and Bruno Haible.
+
        sys_stat: guarantee struct timespec
        * lib/sys_stat.in.h (includes): Always include <time.h>
        * modules/sys_stat (Depends-on): Add time.
index 3913ad245f01e9b17eaef86b43546520d98c1d64..05b2b6237b6b7db536f35c94db9d8964b43cd225 100644 (file)
@@ -6,7 +6,7 @@ time
 sleep
 
 configure.ac:
-AC_CHECK_FUNCS([usleep])
+AC_CHECK_FUNCS_ONCE([usleep])
 
 Makefile.am:
 TESTS += test-stat-time
index da52851b569325dd3b5c47d386ceecfb759abd99..97a719ac8beef3d72ad588f1b9d6bf697caaf6d4 100644 (file)
@@ -115,7 +115,8 @@ nap (void)
       struct stat st2;
       ASSERT (stat ("t-stt-stamp1", &st1) == 0);
       ASSERT (unlink ("t-stt-stamp1") == 0);
-      usleep (delay = 15000);
+      delay = 15000;
+      usleep (delay);
       create_file ("t-stt-stamp1");
       ASSERT (stat ("t-stt-stamp1", &st2) == 0);
       if (st1.st_mtime != st2.st_mtime)