--- libev/ev.c 2007/10/31 16:29:52 1.18 +++ libev/ev.c 2007/10/31 17:55:55 1.19 @@ -41,8 +41,6 @@ #include #include -#define HAVE_EPOLL 1 - #ifndef HAVE_MONOTONIC # ifdef CLOCK_MONOTONIC # define HAVE_MONOTONIC 1 @@ -190,6 +188,19 @@ event (events [i], type); } +/* called on EBADF to verify fds */ +static void +fd_recheck () +{ + int fd; + + for (fd = 0; fd < anfdmax; ++fd) + if (anfds [fd].wev) + if (fcntl (fd, F_GETFD) == -1 && errno == EBADF) + while (anfds [fd].head) + evio_stop (anfds [fd].head); +} + /*****************************************************************************/ static struct ev_timer **timers;