From: Eric Blake Date: Mon, 12 Oct 2009 16:37:48 +0000 (-0600) Subject: stat-time-tests: minor cleanups X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17090f6df956bccaa61b2b395c3df450ec49a6fe;p=pspp 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 --- diff --git a/ChangeLog b/ChangeLog index 1768d740df..3c1077b4df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-10-12 Eric Blake + 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 * modules/sys_stat (Depends-on): Add time. diff --git a/modules/stat-time-tests b/modules/stat-time-tests index 3913ad245f..05b2b6237b 100644 --- a/modules/stat-time-tests +++ b/modules/stat-time-tests @@ -6,7 +6,7 @@ time sleep configure.ac: -AC_CHECK_FUNCS([usleep]) +AC_CHECK_FUNCS_ONCE([usleep]) Makefile.am: TESTS += test-stat-time diff --git a/tests/test-stat-time.c b/tests/test-stat-time.c index da52851b56..97a719ac8b 100644 --- a/tests/test-stat-time.c +++ b/tests/test-stat-time.c @@ -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)