X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flibsystemd%2Fsd-event%2Fsd-event.c;h=618d1b915ce7343955b15fcf05f6a6d390d763b1;hb=15411c0cb1192799b37ec8f25d6f30e8d7292fc6;hp=0c4e5179e3dfd36347cc3153a4c4bb76d8f584d5;hpb=2eec67acbb00593e414549a7e5b35eb7dd776b1b;p=elogind.git diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c index 0c4e5179e..618d1b915 100644 --- a/src/libsystemd/sd-event/sd-event.c +++ b/src/libsystemd/sd-event/sd-event.c @@ -36,7 +36,6 @@ #include "sd-event.h" -#define EPOLL_QUEUE_MAX 512U #define DEFAULT_ACCURACY_USEC (250 * USEC_PER_MSEC) typedef enum EventSourceType { @@ -462,7 +461,7 @@ _public_ sd_event* sd_event_unref(sd_event *e) { static bool event_pid_changed(sd_event *e) { assert(e); - /* We don't support people creating am event loop and keeping + /* We don't support people creating an event loop and keeping * it around over a fork(). Let's complain. */ return e->original_pid != getpid(); @@ -920,7 +919,7 @@ _public_ int sd_event_add_time( callback = time_exit_callback; type = clock_to_event_source_type(clock); - assert_return(type >= 0, -ENOTSUP); + assert_return(type >= 0, -EOPNOTSUPP); d = event_get_clock_data(e, type); assert(d); @@ -2366,7 +2365,7 @@ _public_ int sd_event_wait(sd_event *e, uint64_t timeout) { return 1; } - ev_queue_max = CLAMP(e->n_sources, 1U, EPOLL_QUEUE_MAX); + ev_queue_max = MAX(e->n_sources, 1u); ev_queue = newa(struct epoll_event, ev_queue_max); m = epoll_wait(e->epoll_fd, ev_queue, ev_queue_max,