projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Proper check and dropin replacement for usleep().
[tinc]
/
src
/
dropin.c
diff --git
a/src/dropin.c
b/src/dropin.c
index
52fb5b8
..
1bad05c
100644
(file)
--- a/
src/dropin.c
+++ b/
src/dropin.c
@@
-164,9
+164,10
@@
int gettimeofday(struct timeval *tv, void *tz) {
}
#endif
-#if
def HAVE_MINGW
+#if
ndef HAVE_USLEEP
int usleep(long usec) {
- Sleep(usec / 1000);
+ struct timeval tv = {usec / 1000000, (usec / 1000) % 1000};
+ select(0, NULL, NULL, NULL, &tv);
return 0;
}
#endif