From c6ee2fd59594e89b1871fea6c73535e2bf8920bd Mon Sep 17 00:00:00 2001 From: jokea Date: Wed, 23 May 2012 17:19:49 +0800 Subject: [PATCH] Set fd to writable when poll(2) detects POLLERR or POLLHUP event. --- src/ae.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ae.c b/src/ae.c index 69de51a02..3e6bf911e 100644 --- a/src/ae.c +++ b/src/ae.c @@ -371,6 +371,8 @@ int aeWait(int fd, int mask, long long milliseconds) { if ((retval = poll(&pfd, 1, milliseconds))== 1) { if (pfd.revents & POLLIN) retmask |= AE_READABLE; if (pfd.revents & POLLOUT) retmask |= AE_WRITABLE; + if (pfd.revents & POLLERR) retmask |= AE_WRITABLE; + if (pfd.revents & POLLHUP) retmask |= AE_WRITABLE; return retmask; } else { return retval; -- GitLab