]> granicus.if.org Git - libevent/commitdiff
Suppress a spurious EPERM warning in epoll.c
authorNick Mathewson <nickm@torproject.org>
Thu, 8 Jul 2010 18:41:02 +0000 (14:41 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 8 Jul 2010 18:41:02 +0000 (14:41 -0400)
It's okay for us to get an EPERM when doing an EPOLL_DEL on an fd; it
just means that before we got a chance to the EPOLL_DEL, we closed the
fd and reopened a new non-socket that wound up having the same fd.

Partial fix for Bug 3019973.

epoll.c

diff --git a/epoll.c b/epoll.c
index 6c3cf33f1d159cf292876451e8486e501c1c1102..6707ae8a8218c8569784a6b42394b2b9a9c85551 100644 (file)
--- a/epoll.c
+++ b/epoll.c
@@ -235,7 +235,8 @@ epoll_apply_changes(struct event_base *base)
                                 */
                                event_debug(("  ADD was redundant"));
                        } else if (op == EPOLL_CTL_DEL &&
-                           (errno == ENOENT || errno == EBADF)) {
+                           (errno == ENOENT || errno == EBADF ||
+                               errno == EPERM)) {
                                /* If a delete fails with one of these errors,
                                 * that's fine too: we closed the fd before we
                                 * got around to calling epoll_dispatch. */