summaryrefslogtreecommitdiff
path: root/evport.c
diff options
context:
space:
mode:
Diffstat (limited to 'evport.c')
-rw-r--r--evport.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/evport.c b/evport.c
index 4d341621..1b78960f 100644
--- a/evport.c
+++ b/evport.c
@@ -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