]> git.meshlink.io Git - meshlink-tiny/commitdiff
Use usleep() instead of nanosleep().
authorGuus Sliepen <guus@meshlink.io>
Mon, 12 Jul 2021 19:55:16 +0000 (21:55 +0200)
committerGuus Sliepen <guus@meshlink.io>
Thu, 2 Sep 2021 21:50:51 +0000 (23:50 +0200)
src/net.c

index d930d1fdd7a2c36e61ee4b11a88f9e32a7a43cf7..af7bbdf207b4b08dd7f98344acd4359eeed45fe0 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -151,7 +151,7 @@ static void periodic_handler(event_loop_t *loop, void *data) {
        if(mesh->contradicting_del_edge > 100 && mesh->contradicting_add_edge > 100) {
                logger(mesh, MESHLINK_WARNING, "Possible node with same Name as us! Sleeping %d seconds.", mesh->sleeptime);
                struct timespec ts = {mesh->sleeptime, 0};
-               nanosleep(&ts, NULL);
+               usleep(mesh->sleeptime * 1000000);
                mesh->sleeptime *= 2;
 
                if(mesh->sleeptime < 0) {