server: Round up the timeout for poll() to avoid redundant calls.
This commit is contained in:
parent
5522446848
commit
4d1d49b78a
|
@ -516,7 +516,7 @@ static int get_next_timeout(void)
|
|||
{
|
||||
struct timeout_user *timeout = LIST_ENTRY( ptr, struct timeout_user, entry );
|
||||
int diff = (timeout->when.tv_sec - now.tv_sec) * 1000
|
||||
+ (timeout->when.tv_usec - now.tv_usec) / 1000;
|
||||
+ (timeout->when.tv_usec - now.tv_usec + 999) / 1000;
|
||||
if (diff < 0) diff = 0;
|
||||
return diff;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue