diff --git a/include/types/fd.h b/include/types/fd.h index 580e18053..dae1c90c9 100644 --- a/include/types/fd.h +++ b/include/types/fd.h @@ -162,7 +162,8 @@ struct fdinfo { * - flags indicate what the poller supports (HAP_POLL_F_*) */ -#define HAP_POLL_F_RDHUP 0x00000001 /* the poller notifies of HUP with reads */ +#define HAP_POLL_F_RDHUP 0x00000001 /* the poller notifies of HUP with reads */ +#define HAP_POLL_F_ERRHUP 0x00000002 /* the poller reports ERR and HUP */ struct poller { void *private; /* any private data for the poller */ diff --git a/src/ev_epoll.c b/src/ev_epoll.c index dc156e58f..8b2c2eebe 100644 --- a/src/ev_epoll.c +++ b/src/ev_epoll.c @@ -360,7 +360,7 @@ static void _do_register(void) p->name = "epoll"; p->pref = 300; - p->flags = 0; + p->flags = HAP_POLL_F_ERRHUP; // note: RDHUP might be dynamically added p->private = NULL; p->clo = __fd_clo; diff --git a/src/ev_evports.c b/src/ev_evports.c index bde617d5f..2aea20123 100644 --- a/src/ev_evports.c +++ b/src/ev_evports.c @@ -422,7 +422,7 @@ static void _do_register(void) p->name = "evports"; p->pref = 300; - p->flags = 0; + p->flags = HAP_POLL_F_ERRHUP; p->private = NULL; p->clo = NULL; diff --git a/src/ev_kqueue.c b/src/ev_kqueue.c index 98fac8520..3514f2d7b 100644 --- a/src/ev_kqueue.c +++ b/src/ev_kqueue.c @@ -358,7 +358,7 @@ static void _do_register(void) p->name = "kqueue"; p->pref = 300; - p->flags = HAP_POLL_F_RDHUP; + p->flags = HAP_POLL_F_RDHUP | HAP_POLL_F_ERRHUP; p->private = NULL; p->clo = NULL; diff --git a/src/ev_poll.c b/src/ev_poll.c index 7655ca559..47ce14bbf 100644 --- a/src/ev_poll.c +++ b/src/ev_poll.c @@ -328,7 +328,7 @@ static void _do_register(void) p->name = "poll"; p->pref = 200; - p->flags = 0; + p->flags = HAP_POLL_F_ERRHUP; p->private = NULL; p->clo = __fd_clo;