src/server/daemon/event_linux.c

changeset 542
1327febf99c4
parent 541
1e1fca11aaff
child 543
3335f431a91b
--- a/src/server/daemon/event_linux.c	Sun Aug 11 13:26:17 2024 +0200
+++ b/src/server/daemon/event_linux.c	Sun Aug 11 18:51:39 2024 +0200
@@ -135,7 +135,7 @@
                 int saved_ev = event->events;
                 if(!event->fn(h, event)) {
                     // event fn returned 0 -> remove event from epoll
-                    if(epoll_ctl(ep, EPOLL_CTL_DEL, event->object, NULL)) {
+                    if(saved_ev && epoll_ctl(ep, EPOLL_CTL_DEL, event->object, NULL)) {
                         event->error = 1;
                         log_ereport(
                                 LOG_FAILURE,

mercurial