+ if (timers) {
+ struct timeabs now, first;
+
+ now = nowfn();
+
+ /* Call functions for expired timers. */
+ *expired = timers_expire(timers, now);
+ if (*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);