X-Git-Url: https://git.llucax.com/software/libev.git/blobdiff_plain/bf7b6162766ceeaace65f5172e4ee303f14c3884..f2f56d433ed4bf97e96e4d1df5fb9f3795b768b3:/ev_poll.c?ds=inline diff --git a/ev_poll.c b/ev_poll.c index d0b7299..726a45b 100644 --- a/ev_poll.c +++ b/ev_poll.c @@ -53,7 +53,7 @@ poll_modify (EV_P_ int fd, int oev, int nev) if (idx < 0) /* need to allocate a new pollfd */ { pollidxs [fd] = idx = pollcnt++; - array_needsize (struct pollfd, polls, pollmax, pollcnt, ); + array_needsize (struct pollfd, polls, pollmax, pollcnt, (void)); polls [idx].fd = fd; } @@ -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