[systemd-devel] [PATCH] sd-event: we do not support EPOLLONESHOT correctly

Shawn Landden shawn at churchofgit.com
Fri Dec 13 13:08:44 PST 2013


If this event is not the highest priority, then it will not
be dispatched when the epoll triggers, and since we will
not get any more wakeups (due to the way EPOLLONESHOT works)
will never be dispatched.

Since we only handle one event per epoll_wait() wakeup,
and we dequeue a ONE_SHOT event when we dispatch it, we
do not have the problem described in epoll(7) of
"multiple events can be generated upon receipt of multiple
chunks of data".
---
 src/libsystemd-bus/sd-event.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/libsystemd-bus/sd-event.c b/src/libsystemd-bus/sd-event.c
index 462dd41..1cf661e 100644
--- a/src/libsystemd-bus/sd-event.c
+++ b/src/libsystemd-bus/sd-event.c
@@ -447,9 +447,6 @@ static int source_io_register(
         ev.events = events;
         ev.data.ptr = s;
 
-        if (enabled == SD_EVENT_ONESHOT)
-                ev.events |= EPOLLONESHOT;
-
         if (s->io.registered)
                 r = epoll_ctl(s->event->epoll_fd, EPOLL_CTL_MOD, s->io.fd, &ev);
         else
-- 
1.8.5.1



More information about the systemd-devel mailing list