diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-02-21 23:27:23 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-02-21 23:27:23 -0500 |
commit | 8f5cca47dd6a74e13e358a911ff580d0ba94fb46 (patch) | |
tree | b7b7905b4a991fe65817b03d9a9b8414fa85fea3 /evport.c | |
parent | 9f5bf6639625f66055c1858551dd6d2208809ce6 (diff) | |
parent | 63a715e125cd6ad24b672411b10946ff89d113fe (diff) | |
download | libevent-8f5cca47dd6a74e13e358a911ff580d0ba94fb46.tar.gz |
Merge remote branch 'origin/patches-2.0'
Diffstat (limited to 'evport.c')
-rw-r--r-- | evport.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -337,10 +337,14 @@ evport_dispatch(struct event_base *base, struct timeval *tv) * (because we have to pass this to the callback) */ res = 0; - if (pevt->portev_events & POLLIN) - res |= EV_READ; - if (pevt->portev_events & POLLOUT) - res |= EV_WRITE; + if (pevt->portev_events & (POLLERR|POLLHUP)) { + res = EV_READ | EV_WRITE; + } else { + if (pevt->portev_events & POLLIN) + res |= EV_READ; + if (pevt->portev_events & POLLOUT) + res |= EV_WRITE; + } /* * Check for the error situations or a hangup situation |