summaryrefslogtreecommitdiffstats
path: root/test/vfd_swmr_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/vfd_swmr_common.c')
-rw-r--r--test/vfd_swmr_common.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/test/vfd_swmr_common.c b/test/vfd_swmr_common.c
index 0a5025d..f7152b9 100644
--- a/test/vfd_swmr_common.c
+++ b/test/vfd_swmr_common.c
@@ -72,19 +72,13 @@ below_speed_limit(struct timespec *last, const struct timespec *ival)
return result;
}
-/* Sleep for `tenths` tenths of a second.
- *
- * This routine may quietly perform a too-short sleep if an error occurs
- * in nanosleep(2).
- */
+/* Sleep for `tenths` tenths of a second. */
void
decisleep(uint32_t tenths)
{
- struct timespec delay = {.tv_sec = tenths / 10,
- .tv_nsec = tenths * 100 * 1000 * 1000};
+ uint64_t nsec = tenths * 100 * 1000 * 1000;
- while (nanosleep(&delay, &delay) == -1 && errno == EINTR)
- ; // do nothing
+ H5_nanosleep(nsec);
}
/* Like vsnprintf(3), but abort the program with an error message on