From 0047ba0e9f664b4c2ca202b7aa6c2dd63ed4ca81 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Sat, 8 Aug 2015 12:55:46 -0400 Subject: [PATCH] fix rare bug preventing toxcore from sleeping --- src/toxic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/toxic.c b/src/toxic.c index 1d64efc..9258c47 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -1048,7 +1048,7 @@ static int init_default_data_files(void) /* Adjusts usleep value so that tox_do runs close to the recommended number of times per second */ static useconds_t optimal_msleepval(uint64_t *looptimer, uint64_t *loopcount, uint64_t cur_time, useconds_t msleepval) { - useconds_t new_sleep = msleepval; + useconds_t new_sleep = MAX(msleepval, 3); ++(*loopcount); if (*looptimer == cur_time)