From e16ead8dd9d4600664058069f0695832dfe068b2 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sat, 23 Jul 2011 14:11:44 +0200 Subject: [PATCH] Use usleep() instead of sleep(), MinGW complained. --- lib/dropin.c | 2 +- lib/dropin.h | 2 +- src/net.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dropin.c b/lib/dropin.c index 4aed74e..eb17aca 100644 --- a/lib/dropin.c +++ b/lib/dropin.c @@ -165,7 +165,7 @@ int gettimeofday(struct timeval *tv, void *tz) { #endif #ifndef HAVE_USLEEP -int usleep(long usec) { +int usleep(long long usec) { struct timeval tv = {usec / 1000000, (usec / 1000) % 1000}; select(0, NULL, NULL, NULL, &tv); return 0; diff --git a/lib/dropin.h b/lib/dropin.h index 22fe36d..dc7dbee 100644 --- a/lib/dropin.h +++ b/lib/dropin.h @@ -42,7 +42,7 @@ extern int gettimeofday(struct timeval *, void *); #endif #ifndef HAVE_USLEEP -extern int usleep(long); +extern int usleep(long long); #endif #endif /* __DROPIN_H__ */ diff --git a/src/net.c b/src/net.c index b3f924a..8762db3 100644 --- a/src/net.c +++ b/src/net.c @@ -472,7 +472,7 @@ int main_loop(void) { if(contradicting_del_edge > 100 && contradicting_add_edge > 100) { logger(LOG_WARNING, "Possible node with same Name as us! Sleeping %d seconds.", sleeptime); - sleep(sleeptime); + usleep(sleeptime * 1000000LL); sleeptime *= 2; if(sleeptime < 0) sleeptime = 3600; -- 2.25.1