aboutsummaryrefslogtreecommitdiff
path: root/src/platform/posix/posix_clock.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/platform/posix/posix_clock.c')
-rw-r--r--src/platform/posix/posix_clock.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/platform/posix/posix_clock.c b/src/platform/posix/posix_clock.c
index c4206ebe..215f66e6 100644
--- a/src/platform/posix/posix_clock.c
+++ b/src/platform/posix/posix_clock.c
@@ -47,7 +47,9 @@ nni_usleep(nni_duration usec)
/* Do this in a loop, so that interrupts don't actually wake us. */
while (ts.tv_sec || ts.tv_nsec) {
- (void) nanosleep(&ts, &ts);
+ if (nanosleep(&ts, &ts) == 0) {
+ break;
+ }
}
}