diff options
| author | Garrett D'Amore <garrett@damore.org> | 2016-12-23 12:15:40 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2016-12-23 12:15:40 -0800 |
| commit | 667262f214441c66bcaeeae3b1b2ecbecf4aaf64 (patch) | |
| tree | 9912966cf831c39f45a44eb0fd88fa1b92e35936 /src/platform/posix/posix_clock.c | |
| parent | a12baf41fb17ef51a8b1d0c82e31113454c5beae (diff) | |
| download | nng-667262f214441c66bcaeeae3b1b2ecbecf4aaf64.tar.gz nng-667262f214441c66bcaeeae3b1b2ecbecf4aaf64.tar.bz2 nng-667262f214441c66bcaeeae3b1b2ecbecf4aaf64.zip | |
Fix for incorrect nni_usleep(), found with newly created platform tests.
Diffstat (limited to 'src/platform/posix/posix_clock.c')
| -rw-r--r-- | src/platform/posix/posix_clock.c | 4 |
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; + } } } |
