X-Git-Url: https://git.llucax.com/software/libev.git/blobdiff_plain/fbe9562600fa8735c078401aa604b49a5426b0e2..0f411518435b7edf24d4bddcc86e5958f7e3d23f:/ev_epoll.c?ds=inline diff --git a/ev_epoll.c b/ev_epoll.c index ffb1f05..4689f8d 100644 --- a/ev_epoll.c +++ b/ev_epoll.c @@ -43,7 +43,9 @@ epoll_modify (EV_P_ int fd, int oev, int nev) | (nev & EV_WRITE ? EPOLLOUT : 0); if (epoll_ctl (epoll_fd, mode, fd, &ev)) - fd_kill (EV_A_ fd); + if (errno != ENOENT /* on ENOENT the fd went away, so try to do the right thing */ + || (nev && epoll_ctl (epoll_fd, EPOLL_CTL_ADD, fd, &ev))) + fd_kill (EV_A_ fd); } static void