From: root Date: Mon, 12 Nov 2007 00:50:41 +0000 (+0000) Subject: handle pollnval X-Git-Tag: rel-0_8~4 X-Git-Url: https://git.llucax.com/software/libev.git/commitdiff_plain/1c98724c8fe77a60fa8f7fe4aca6197a7efad110?ds=sidebyside handle pollnval --- diff --git a/ev_poll.c b/ev_poll.c index d0b7299..4812021 100644 --- a/ev_poll.c +++ b/ev_poll.c @@ -94,12 +94,15 @@ poll_poll (EV_P_ ev_tstamp timeout) } for (i = 0; i < pollcnt; ++i) - fd_event ( - EV_A_ - polls [i].fd, - (polls [i].revents & (POLLOUT | POLLERR | POLLHUP) ? EV_WRITE : 0) - | (polls [i].revents & (POLLIN | POLLERR | POLLHUP) ? EV_READ : 0) - ); + if (polls [i].revents & POLLNVAL) + fd_kill (EV_A_ polls [i].fd); + else + fd_event ( + EV_A_ + polls [i].fd, + (polls [i].revents & (POLLOUT | POLLERR | POLLHUP) ? EV_WRITE : 0) + | (polls [i].revents & (POLLIN | POLLERR | POLLHUP) ? EV_READ : 0) + ); } static int