Update connection/connection.c

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.
This commit is contained in:
Yongkang Chen
2013-01-24 15:19:50 +08:00
parent 5f12e7e3f0
commit 9fb5596921

View File

@@ -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);