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 1768d74..3c1077b 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 3913ad2..05b2b62 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 da52851..97a719a 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)