mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-04 04:31:27 +00:00
Remove the cap on epoll events
Currently the code will silently blank out events if there are more
then 512 epoll events, causing them never to be handled at all. This
patch removes the cap on the number of events for epoll_wait, thereby
avoiding this issue.
(cherry picked from commit 1c724e9e0e)
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
cc32b9d93a
commit
c2695a243c
@@ -37,7 +37,6 @@
|
||||
|
||||
#include "sd-event.h"
|
||||
|
||||
#define EPOLL_QUEUE_MAX 512U
|
||||
#define DEFAULT_ACCURACY_USEC (250 * USEC_PER_MSEC)
|
||||
|
||||
typedef enum EventSourceType {
|
||||
@@ -2367,7 +2366,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,
|
||||
|
||||
Reference in New Issue
Block a user