mirror of
https://github.com/systemd/systemd.git
synced 2024-11-07 09:56:51 +03:00
event: make sure to possibly disarm the timerfds before we reenter epoll_wait
This commit is contained in:
parent
c57b5ca301
commit
1b5995b039
@ -1756,19 +1756,17 @@ _public_ int sd_event_run(sd_event *e, uint64_t timeout) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
||||||
|
r = event_arm_timer(e, e->monotonic_fd, e->monotonic_earliest, e->monotonic_latest, &e->monotonic_next);
|
||||||
|
if (r < 0)
|
||||||
|
goto finish;
|
||||||
|
|
||||||
|
r = event_arm_timer(e, e->realtime_fd, e->realtime_earliest, e->realtime_latest, &e->realtime_next);
|
||||||
|
if (r < 0)
|
||||||
|
goto finish;
|
||||||
|
|
||||||
if (event_next_pending(e) || e->need_process_child)
|
if (event_next_pending(e) || e->need_process_child)
|
||||||
timeout = 0;
|
timeout = 0;
|
||||||
|
|
||||||
if (timeout > 0) {
|
|
||||||
r = event_arm_timer(e, e->monotonic_fd, e->monotonic_earliest, e->monotonic_latest, &e->monotonic_next);
|
|
||||||
if (r < 0)
|
|
||||||
goto finish;
|
|
||||||
|
|
||||||
r = event_arm_timer(e, e->realtime_fd, e->realtime_earliest, e->realtime_latest, &e->realtime_next);
|
|
||||||
if (r < 0)
|
|
||||||
goto finish;
|
|
||||||
}
|
|
||||||
|
|
||||||
m = epoll_wait(e->epoll_fd, ev_queue, EPOLL_QUEUE_MAX,
|
m = epoll_wait(e->epoll_fd, ev_queue, EPOLL_QUEUE_MAX,
|
||||||
timeout == (uint64_t) -1 ? -1 : (int) ((timeout + USEC_PER_MSEC - 1) / USEC_PER_MSEC));
|
timeout == (uint64_t) -1 ? -1 : (int) ((timeout + USEC_PER_MSEC - 1) / USEC_PER_MSEC));
|
||||||
if (m < 0) {
|
if (m < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user