ev: fix epoll_init file descriptor leak

Fix the edge case where epoll_init() leaks a file descriptor when it is called
when the process has no open file descriptors.
This commit is contained in:
Ben Noordhuis 2011-10-31 04:19:19 +01:00
parent 70381cef9b
commit bd82d02467

View File

@ -225,7 +225,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);