--- libev/ev_poll.c 2007/11/08 17:24:00 1.10 +++ libev/ev_poll.c 2007/11/12 20:03:39 1.14 @@ -53,7 +53,7 @@ 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, EMPTY2); polls [idx].fd = fd; } @@ -79,7 +79,7 @@ poll_poll (EV_P_ ev_tstamp timeout) { int i; - int res = poll (polls, pollcnt, ceil (timeout * 1000.)); + int res = poll (polls, pollcnt, (int)ceil (timeout * 1000.)); if (res < 0) { @@ -94,12 +94,15 @@ } 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