diff --git a/src/unix/core.c b/src/unix/core.c index 6b10af568..04999dce3 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -1558,8 +1558,14 @@ int uv_gettimeofday(uv_timeval64_t* tv) { void uv_sleep(unsigned int msec) { struct timespec timeout; + int rc; timeout.tv_sec = msec / 1000; timeout.tv_nsec = (msec % 1000) * 1000 * 1000; - nanosleep(&timeout, NULL); + + do + rc = nanosleep(&timeout, &timeout); + while (rc == -1 && errno == EINTR); + + assert(rc == 0); }