summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-02-05 18:03:10 +0100
committerAttila Molnar <attilamolnar@hush.com>2014-02-05 18:03:10 +0100
commitc9ee23a0fd785b4314c29c5cc5326d572daa952f (patch)
tree315260d69265461c7e7553162831e2c5253aaa9b /src
parent594b9e031c9d9c209ab8d2475255442c6eb7a343 (diff)
socketengine_epoll Remove needless initialization of epoll_event when removing an fd
Diffstat (limited to 'src')
-rw-r--r--src/socketengines/socketengine_epoll.cpp5
1 files 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)