From: Hajime Tazaki <[email protected]> when nanosleep(2) is used in rumpuser_clock_sleep(), it will properly retry if errno == EINTR, but with clock_nanosleep(2) it won't. This patch aligns the error values of clock_nanosleep() to nanosleep's case.
Signed-off-by: Hajime Tazaki <[email protected]> --- lib/librumpuser/rumpuser.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librumpuser/rumpuser.c b/lib/librumpuser/rumpuser.c index 60f41b477eb4..1810c4023a26 100644 --- a/lib/librumpuser/rumpuser.c +++ b/lib/librumpuser/rumpuser.c @@ -140,6 +140,8 @@ rumpuser_clock_sleep(int enum_rumpclock, int64_t sec, long nsec) #ifdef HAVE_CLOCK_NANOSLEEP rv = clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &rqt, NULL); + if (rv) + errno = rv; rv = -1; #else /* le/la/der/die/das sigh. timevalspec tailspin */ struct timespec ts, tsr; -- 2.1.0
