Replace usleep() with nanosleep().

This commit is contained in:
Guus Sliepen 2016-04-14 17:20:36 +02:00
parent 491839a81a
commit b5b04910b9
4 changed files with 9 additions and 10 deletions

View file

@ -181,7 +181,7 @@ static void periodic_handler(void *data) {
if(contradicting_del_edge > 100 && contradicting_add_edge > 100) {
logger(DEBUG_ALWAYS, LOG_WARNING, "Possible node with same Name as us! Sleeping %d seconds.", sleeptime);
usleep(sleeptime * 1000000LL);
nanosleep(&(struct timespec){sleeptime, 0}, NULL);
sleeptime *= 2;
if(sleeptime < 0)
sleeptime = 3600;