summaryrefslogtreecommitdiff
path: root/src/ae.c
diff options
context:
space:
mode:
authorjokea <tfengjun@gmail.com>2012-05-23 17:19:49 +0800
committerantirez <antirez@gmail.com>2012-05-23 11:33:32 +0200
commite150ce3ce6375de2f11784935483e85cf3bbcf59 (patch)
treefc59202140b247d0c77d790e74a644b1648dcdf7 /src/ae.c
parent348ee1a40a4d8105dfaf6fa2ab2dffc15a47d86d (diff)
downloadredis-e150ce3ce6375de2f11784935483e85cf3bbcf59.tar.gz
Set fd to writable when poll(2) detects POLLERR or POLLHUP event.
Diffstat (limited to 'src/ae.c')
-rw-r--r--src/ae.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ae.c b/src/ae.c
index c58c4b74b..ba53b4568 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;