Consisten use of TIMEOUT_FOREVER

This commit is contained in:
Neil Cook 2016-12-14 17:50:39 +00:00
parent c1d5ae9a25
commit 0d39563978
1 changed files with 5 additions and 2 deletions

View File

@ -266,7 +266,7 @@ default_eventloop_run_once(getdns_eventloop *loop, int blocking)
timeout = s->timeout_time;
}
if ((timeout == (uint64_t)-1) && (num_pfds == 0))
if ((timeout == TIMEOUT_FOREVER) && (num_pfds == 0))
return;
pfds = calloc(num_pfds, sizeof(struct pollfd));
@ -283,7 +283,10 @@ default_eventloop_run_once(getdns_eventloop *loop, int blocking)
i++;
}
if (! blocking || now > timeout) {
if (timeout == TIMEOUT_FOREVER) {
poll_timeout = -1;
}
else if (! blocking || now > timeout) {
poll_timeout = 0;
} else {
poll_timeout = (timeout - now) * 1000; /* turn seconds into millseconds */