diff options
author | Bert Belder <bertbelder@gmail.com> | 2012-04-29 00:22:01 +0200 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2012-04-29 00:22:01 +0200 |
commit | d2dd9d108d6bd61ac49522450b98ad57eac5be45 (patch) | |
tree | a53bd3b01637cff18fe01552f6a3cf006189929f /deps/uv/src/unix/pipe.c | |
parent | c8a10e97c8def4c6a89f34f655b675d4204e16d4 (diff) | |
download | android-node-v8-d2dd9d108d6bd61ac49522450b98ad57eac5be45.tar.gz android-node-v8-d2dd9d108d6bd61ac49522450b98ad57eac5be45.tar.bz2 android-node-v8-d2dd9d108d6bd61ac49522450b98ad57eac5be45.zip |
uv: upgrade to e2cae340a6
Diffstat (limited to 'deps/uv/src/unix/pipe.c')
-rw-r--r-- | deps/uv/src/unix/pipe.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/deps/uv/src/unix/pipe.c b/deps/uv/src/unix/pipe.c index 3573a57105..7d0b2ec70b 100644 --- a/deps/uv/src/unix/pipe.c +++ b/deps/uv/src/unix/pipe.c @@ -146,29 +146,19 @@ out: } -int uv_pipe_cleanup(uv_pipe_t* handle) { - int saved_errno; - int status; - - saved_errno = errno; - status = -1; - +void uv__pipe_close(uv_pipe_t* handle) { if (handle->pipe_fname) { /* * Unlink the file system entity before closing the file descriptor. * Doing it the other way around introduces a race where our process * unlinks a socket with the same name that's just been created by * another thread or process. - * - * This is less of an issue now that we attach a file lock - * to the socket but it's still a best practice. */ unlink(handle->pipe_fname); free((void*)handle->pipe_fname); } - errno = saved_errno; - return status; + uv__stream_close((uv_stream_t*)handle); } @@ -254,16 +244,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); } } |