From 93b0075d33292bb74bccb60d205da2c2f2041f1d Mon Sep 17 00:00:00 2001 From: jokea Date: Fri, 29 Jun 2012 12:06:38 +0800 Subject: [PATCH] mark fd as writable when EPOLLERR or EPOLLHUP is returned by epoll_wait. --- src/ae_epoll.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ae_epoll.c b/src/ae_epoll.c index cac10d67f..0231f2435 100644 --- a/src/ae_epoll.c +++ b/src/ae_epoll.c @@ -89,6 +89,8 @@ static int aeApiPoll(aeEventLoop *eventLoop, struct timeval *tvp) { if (e->events & EPOLLIN) mask |= AE_READABLE; if (e->events & EPOLLOUT) mask |= AE_WRITABLE; + if (e->events & EPOLLERR) mask |= AE_WRITABLE; + if (e->events & EPOLLHUP) mask |= AE_WRITABLE; eventLoop->fired[j].fd = e->data.fd; eventLoop->fired[j].mask = mask; } -- GitLab