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);

_______________________________________________
libev mailing list
libev@lists.schmorp.de
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to