X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet.c;h=c2c5d198ddb08f829d2a3b751156add7d314470c;hb=0037ec7cb38994dda6ab5e4fa85ce595b9a59f6b;hp=a539425668b865b61bba91c2112d2530945b1dc2;hpb=3ccdf50beb6b2d3f2730bdc66006b43190537cde;p=tinc diff --git a/src/net.c b/src/net.c index a5394256..c2c5d198 100644 --- a/src/net.c +++ b/src/net.c @@ -152,7 +152,7 @@ static void timeout_handler(void *data) { if(c->edge) { try_tx(c->node, false); if(c->status.pinged) { - logger(DEBUG_CONNECTIONS, LOG_INFO, "%s (%s) didn't respond to PING in %ld seconds", c->name, c->hostname, (long)now.tv_sec - c->last_ping_time); + logger(DEBUG_CONNECTIONS, LOG_INFO, "%s (%s) didn't respond to PING in %ld seconds", c->name, c->hostname, (long)(now.tv_sec - c->last_ping_time)); } else if(c->last_ping_time + pinginterval <= now.tv_sec) { send_ping(c); continue; @@ -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;