From: jokea <tfengjun@gmail.com>
Date: Wed, 23 May 2012 09:19:49 +0000 (+0800)
Subject: Set fd to writable when poll(2) detects POLLERR or POLLHUP event.
X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/a5a037bf8134b58b5130168e0eb1526106e5b26c

Set fd to writable when poll(2) detects POLLERR or POLLHUP event.
---

diff --git a/src/ae.c b/src/ae.c
index c58c4b74..ba53b456 100644
--- a/src/ae.c
+++ b/src/ae.c
@@ -385,6 +385,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;