From 667262f214441c66bcaeeae3b1b2ecbecf4aaf64 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 23 Dec 2016 12:15:40 -0800 Subject: Fix for incorrect nni_usleep(), found with newly created platform tests. --- src/platform/posix/posix_clock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/platform/posix/posix_clock.c') 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; + } } } -- cgit v1.2.3-70-g09d2