static unsigned int timeout_remaining_ms(struct timeout *timeout)
{
- if (timeout->ms == 0)
- return -1;
- else if (timeout->limit_ms && timeout->overflow)
+ if (timeout->limit_ms && timeout->overflow)
return timeout->limit_ms;
else
return time_as_ms(&timeout->delta);
break;
}
- result = poll(pollfds, event_set->count, timeout_remaining_ms(&timeout));
+ result = poll(pollfds, event_set->count, timeout_remaining_ms(&timeout) || -1);
started = 1;
if (result < 0) {