From 3ba3ce9bfa75a894da7ec75fb18ea4a57d8cf55d Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 9 Mar 2021 16:52:59 -0800 Subject: Converts nanosleep to H5_nanosleep in genall5.c --- test/genall5.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/test/genall5.c b/test/genall5.c index 904a912..31b5b87 100644 --- a/test/genall5.c +++ b/test/genall5.c @@ -2689,9 +2689,8 @@ create_or_validate_selection(hid_t fid, const char *full_path, static void random_pause(unsigned int max_pause_msecs) { - struct timespec delay; - const uint64_t nsecs_per_sec = 1000 * 1000 * 1000; - uint64_t nsecs_per_msec, nsecs; + uint64_t nsecs_per_msec; + uint64_t nsecs; if (max_pause_msecs == 0) return; @@ -2699,16 +2698,7 @@ random_pause(unsigned int max_pause_msecs) nsecs_per_msec = 1 + (uint64_t)HDrandom() % (1000 * 1000); nsecs = max_pause_msecs * nsecs_per_msec; - delay.tv_sec = (time_t)(nsecs / nsecs_per_sec); - delay.tv_nsec = (long)(nsecs % nsecs_per_sec); - for (;;) { - if (HDnanosleep(&delay, &delay) == 0) - break; - if (errno == EINTR) - continue; - HDfprintf(stderr, "%s: nanosleep", __func__); - HDexit(EXIT_FAILURE); - } + H5_nanosleep(nsecs); } /* Create and validate objects or, if `only_validate` is true, only -- cgit v0.12