aboutsummaryrefslogtreecommitdiff
path: root/libs/xmlrpc-c/patches/010-nanosleep.patch
blob: 52703cb2067c4f9a63dac7f2a7c2ac3c2fc122e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- 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
 }