Merge branch '20_evport_pollhup' into patches-2.0

This commit is contained in:
Nick Mathewson 2011-02-13 02:51:27 -05:00
commit 0c9be76804

View File

@ -336,10 +336,14 @@ evport_dispatch(struct event_base *base, struct timeval *tv)
* (because we have to pass this to the callback) * (because we have to pass this to the callback)
*/ */
res = 0; res = 0;
if (pevt->portev_events & POLLIN) if (pevt->portev_events & (POLLERR|POLLHUP)) {
res |= EV_READ; res = EV_READ | EV_WRITE;
if (pevt->portev_events & POLLOUT) } else {
res |= EV_WRITE; 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 * Check for the error situations or a hangup situation