1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-12 13:18:14 +03:00

sd-event: use DIV_ROUND_UP where appropriate

This commit is contained in:
Lennart Poettering 2019-04-02 14:52:17 +02:00
parent 39f2bc6e7e
commit bab4820ee2

View File

@ -3116,7 +3116,7 @@ _public_ int sd_event_wait(sd_event *e, uint64_t timeout) {
timeout = 0; timeout = 0;
m = epoll_wait(e->epoll_fd, ev_queue, ev_queue_max, m = epoll_wait(e->epoll_fd, ev_queue, ev_queue_max,
timeout == (uint64_t) -1 ? -1 : (int) ((timeout + USEC_PER_MSEC - 1) / USEC_PER_MSEC)); timeout == (uint64_t) -1 ? -1 : (int) DIV_ROUND_UP(timeout, USEC_PER_MSEC));
if (m < 0) { if (m < 0) {
if (errno == EINTR) { if (errno == EINTR) {
e->state = SD_EVENT_PENDING; e->state = SD_EVENT_PENDING;