changeset 12164:0f120c1de4c5

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. Signed-off-by: Eric Blake <ebb9@byu.net>
author Eric Blake <ebb9@byu.net>
date Mon, 12 Oct 2009 10:37:48 -0600
parents e16b6783660e
children c5a8a8e67e6f
files ChangeLog modules/stat-time-tests tests/test-stat-time.c
diffstat 3 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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.
--- a/modules/stat-time-tests
+++ b/modules/stat-time-tests
@@ -6,7 +6,7 @@
 sleep
 
 configure.ac:
-AC_CHECK_FUNCS([usleep])
+AC_CHECK_FUNCS_ONCE([usleep])
 
 Makefile.am:
 TESTS += test-stat-time
--- a/tests/test-stat-time.c
+++ b/tests/test-stat-time.c
@@ -115,7 +115,8 @@
       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)