Advertisement
Guest User

Untitled

a guest
Oct 8th, 2015
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. commit c9620164a48804bd5262a2767f2632edac811c2d
  2. Author: Hajime Tazaki <thehajime@gmail.com>
  3. Date: Thu Oct 8 14:23:09 2015 +0900
  4.  
  5. handle return value of clock_nanosleep(2) correctly
  6.  
  7. when nanosleep(2) is used in rumpuser_clock_sleep(), it will properly
  8. retry when errno == EINTR, but in clock_nanosleep(2) it won't. This
  9. patch align the error values of clock_nanosleep() to nanosleep's case.
  10.  
  11. Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
  12.  
  13. diff --git a/lib/librumpuser/rumpuser.c b/lib/librumpuser/rumpuser.c
  14. index 60f41b477eb4..1810c4023a26 100644
  15. --- a/lib/librumpuser/rumpuser.c
  16. +++ b/lib/librumpuser/rumpuser.c
  17. @@ -140,6 +140,8 @@ rumpuser_clock_sleep(int enum_rumpclock, int64_t sec, long nsec)
  18. #ifdef HAVE_CLOCK_NANOSLEEP
  19. rv = clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME,
  20. &rqt, NULL);
  21. + if (rv)
  22. + errno = rv; rv = -1;
  23. #else
  24. /* le/la/der/die/das sigh. timevalspec tailspin */
  25. struct timespec ts, tsr;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement