+ if (timers) {
+ struct timeabs now, first;
+
+ now = time_now();
+
+ /* Call functions for expired timers. */
+ timers_expire(timers, now, expired);
+ if (!list_empty(expired))
+ break;
+
+ /* Now figure out how long to wait for the next one. */
+ if (timer_earliest(timers, &first)) {
+ uint64_t next;
+ next = time_to_msec(time_between(first, now));
+ if (next < INT_MAX)
+ ms_timeout = next;
+ else
+ ms_timeout = INT_MAX;
+ }
+ }
+
+ r = poll(pollfds, num_fds, ms_timeout);