From c9ee23a0fd785b4314c29c5cc5326d572daa952f Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Wed, 5 Feb 2014 18:03:10 +0100 Subject: socketengine_epoll Remove needless initialization of epoll_event when removing an fd --- src/socketengines/socketengine_epoll.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/socketengines/socketengine_epoll.cpp b/src/socketengines/socketengine_epoll.cpp index b9563ed2b..09fa918c6 100644 --- a/src/socketengines/socketengine_epoll.cpp +++ b/src/socketengines/socketengine_epoll.cpp @@ -167,9 +167,10 @@ void EPollEngine::DelFd(EventHandler* eh) return; } + // Do not initialize epoll_event because for EPOLL_CTL_DEL operations the event is ignored and can be NULL. + // In kernel versions before 2.6.9, the EPOLL_CTL_DEL operation required a non-NULL pointer in event, + // even though this argument is ignored. Since Linux 2.6.9, event can be specified as NULL when using EPOLL_CTL_DEL. struct epoll_event ev; - memset(&ev, 0, sizeof(ev)); - ev.data.fd = fd; int i = epoll_ctl(EngineHandle, EPOLL_CTL_DEL, fd, &ev); if (i < 0) -- cgit v1.2.3