From 12c25e1027e26ffb16f54d17a69a88450e9a23df Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 10 Sep 2012 15:01:50 +0200 Subject: [PATCH] unix: fix EMFILE busy loop Don't spin in epoll_wait() / kevent() / port_getn() / etc. when we can't accept() a new connection due to having reached the file descriptor limit. Pass the error to the connection_cb and let the libuv user deal with it. --- src/unix/stream.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/unix/stream.c b/src/unix/stream.c index 284643e4..ce8a1c18 100644 --- a/src/unix/stream.c +++ b/src/unix/stream.c @@ -186,9 +186,6 @@ void uv__server_io(uv_loop_t* loop, uv__io_t* w, int events) { if (errno == EAGAIN || errno == EWOULDBLOCK) { /* No problem. */ return; - } else if (errno == EMFILE) { - /* TODO special trick. unlock reserved socket, accept, close. */ - return; } else if (errno == ECONNABORTED) { /* ignore */ continue;