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
430 B

--- a/lib/libutil/sleep.c
+++ b/lib/libutil/sleep.c
@@ -8,7 +8,7 @@
# include <windows.h>
# include <process.h>
#else
-# include <unistd.h>
+# include <time.h>
#endif
@@ -18,6 +18,7 @@ xmlrpc_millisecond_sleep(unsigned int co
#if MSVCRT
SleepEx(milliseconds, true);
#else
- usleep(milliseconds * 1000);
+ const struct timespec req = {0, milliseconds * 1000 * 1000};
+ nanosleep(&req, NULL);
#endif
}