From 21bee8c36f0f9086efd457ffcc22b17c5abab2c8 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 21 Apr 2012 06:06:06 +0200 Subject: [PATCH] unix: call pipe handle connection cb on accept() error --- src/unix/pipe.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/unix/pipe.c b/src/unix/pipe.c index f1be9e97..1efb664b 100644 --- a/src/unix/pipe.c +++ b/src/unix/pipe.c @@ -254,16 +254,15 @@ void uv__pipe_accept(EV_P_ ev_io* watcher, int revents) { sockfd = uv__accept(pipe->fd, (struct sockaddr *)&saddr, sizeof saddr); if (sockfd == -1) { - if (errno == EAGAIN || errno == EWOULDBLOCK) { - assert(0 && "EAGAIN on uv__accept(pipefd)"); - } else { + if (errno != EAGAIN && errno != EWOULDBLOCK) { uv__set_sys_error(pipe->loop, errno); + pipe->connection_cb((uv_stream_t*)pipe, -1); } } else { pipe->accepted_fd = sockfd; pipe->connection_cb((uv_stream_t*)pipe, 0); if (pipe->accepted_fd == sockfd) { - /* The user hasn't yet accepted called uv_accept() */ + /* The user hasn't called uv_accept() yet */ ev_io_stop(pipe->loop->ev, &pipe->read_watcher); } }