[PATCH] ev: fix epoll_init fd leak
Ben Noordhuis
info at bnoordhuis.nl
Mon Oct 31 04:18:22 CET 2011
epoll_init() leaks a file descriptor if it's called when the process
has no open file descriptors.
diff --git a/ev_epoll.c b/ev_epoll.c
index 58bf9b9..240b7b9 100644
--- a/ev_epoll.c
+++ b/ev_epoll.c
@@ -238,7 +238,7 @@ epoll_init (EV_P_ int flags)
#ifdef EPOLL_CLOEXEC
backend_fd = epoll_create1 (EPOLL_CLOEXEC);
- if (backend_fd <= 0)
+ if (backend_fd < 0)
#endif
backend_fd = epoll_create (256);
More information about the libev
mailing list