summaryrefslogtreecommitdiff
path: root/ev_epoll.c
diff options
context:
space:
mode:
authorroot <root>2007-11-04 23:14:11 +0000
committerroot <root>2007-11-04 23:14:11 +0000
commit22b2a449105d7604f715c1afafeb4fe5ac473f1b (patch)
treeb18e0643b0b285e16de1ac4641e5aecdc59c1bec /ev_epoll.c
parentfbe9562600fa8735c078401aa604b49a5426b0e2 (diff)
- have to re-check potentially closed fds regularly for epoll. this hurts
badly :( - still more than twice as fats as libevent. - many minor fixes
Diffstat (limited to 'ev_epoll.c')
-rw-r--r--ev_epoll.c4
1 files changed, 3 insertions, 1 deletions
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