From 9fb559692169674a39ba406f01e9d41fc59d4d2f Mon Sep 17 00:00:00 2001 From: Yongkang Chen Date: Thu, 24 Jan 2013 15:19:50 +0800 Subject: [PATCH] Update connection/connection.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit according to "man epoll_ctl": BUGS        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 kernel  2.6.9,        event can be specified as NULL when using EPOLL_CTL_DEL. --- connection/connection.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/connection/connection.c b/connection/connection.c index 889950c8..21d31352 100644 --- a/connection/connection.c +++ b/connection/connection.c @@ -101,7 +101,8 @@ connection_add(struct connection_pool * pool, int fd, void *ud) { void connection_del(struct connection_pool * pool, int fd) { #if HAVE_EPOLL - epoll_ctl(pool->epoll_fd, EPOLL_CTL_DEL, fd , NULL); + struct epoll_event ev; + epoll_ctl(pool->epoll_fd, EPOLL_CTL_DEL, fd , &ev); #elif HAVE_KQUEUE struct kevent ke; EV_SET(&ke, fd, EVFILT_READ, EV_DELETE, 0, 0, NULL);