You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
449 B

  1. --- a/lib/libutil/sleep.c
  2. +++ b/lib/libutil/sleep.c
  3. @@ -8,7 +8,7 @@
  4. # include <windows.h>
  5. # include <process.h>
  6. #else
  7. -# include <unistd.h>
  8. +# include <time.h>
  9. #endif
  10. @@ -18,6 +18,7 @@ xmlrpc_millisecond_sleep(unsigned int const milliseconds) {
  11. #if MSVCRT
  12. SleepEx(milliseconds, true);
  13. #else
  14. - usleep(milliseconds * 1000);
  15. + const struct timespec req = {0, milliseconds * 1000 * 1000};
  16. + nanosleep(&req, NULL);
  17. #endif
  18. }