summaryrefslogtreecommitdiffstats
path: root/libev/ev_epoll.c
diff options
context:
space:
mode:
Diffstat (limited to 'libev/ev_epoll.c')
-rw-r--r--libev/ev_epoll.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libev/ev_epoll.c b/libev/ev_epoll.c
index b4e02c2..a1f04f6 100644
--- a/libev/ev_epoll.c
+++ b/libev/ev_epoll.c
@@ -179,7 +179,7 @@ epoll_poll (EV_P_ ev_tstamp timeout)
if (expect_false ((uint32_t)anfds [fd].egen != (uint32_t)(ev->data.u64 >> 32)))
{
/* recreate kernel state */
- postfork = 1;
+ postfork |= 2;
continue;
}
@@ -203,7 +203,7 @@ epoll_poll (EV_P_ ev_tstamp timeout)
/* which is fortunately easy to do for us. */
if (epoll_ctl (backend_fd, want ? EPOLL_CTL_MOD : EPOLL_CTL_DEL, fd, ev))
{
- postfork = 1; /* an error occurred, recreate kernel state */
+ postfork |= 2; /* an error occurred, recreate kernel state */
continue;
}
}
@@ -228,7 +228,10 @@ epoll_poll (EV_P_ ev_tstamp timeout)
if (anfds [fd].emask & EV_EMASK_EPERM && events)
fd_event (EV_A_ fd, events);
else
- epoll_eperms [i] = epoll_eperms [--epoll_epermcnt];
+ {
+ epoll_eperms [i] = epoll_eperms [--epoll_epermcnt];
+ anfds [fd].emask = 0;
+ }
}
}
@@ -238,7 +241,7 @@ epoll_init (EV_P_ int flags)
#ifdef EPOLL_CLOEXEC
backend_fd = epoll_create1 (EPOLL_CLOEXEC);
- if (backend_fd < 0)
+ if (backend_fd < 0 && (errno == EINVAL || errno == ENOSYS))
#endif
backend_fd = epoll_create (256);