diff options
Diffstat (limited to 'deps/uv/src/unix/pipe.c')
-rw-r--r-- | deps/uv/src/unix/pipe.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/deps/uv/src/unix/pipe.c b/deps/uv/src/unix/pipe.c index f432f4539a..b28c8ef919 100644 --- a/deps/uv/src/unix/pipe.c +++ b/deps/uv/src/unix/pipe.c @@ -57,7 +57,7 @@ int uv_pipe_bind(uv_pipe_t* handle, const char* name) { bound = 0; /* Already bound? */ - if (handle->io_watcher.fd >= 0) { + if (uv__stream_fd(handle) >= 0) { uv__set_artificial_error(handle->loop, UV_EINVAL); goto out; } @@ -117,13 +117,13 @@ int uv_pipe_listen(uv_pipe_t* handle, int backlog, uv_connection_cb cb) { saved_errno = errno; status = -1; - if (handle->io_watcher.fd == -1) { + if (uv__stream_fd(handle) == -1) { uv__set_artificial_error(handle->loop, UV_EINVAL); goto out; } - assert(handle->io_watcher.fd >= 0); + assert(uv__stream_fd(handle) >= 0); - if ((status = listen(handle->io_watcher.fd, backlog)) == -1) { + if ((status = listen(uv__stream_fd(handle), backlog)) == -1) { uv__set_sys_error(handle->loop, errno); } else { handle->connection_cb = cb; @@ -172,7 +172,7 @@ void uv_pipe_connect(uv_connect_t* req, int r; saved_errno = errno; - new_sock = (handle->io_watcher.fd == -1); + new_sock = (uv__stream_fd(handle) == -1); err = -1; if (new_sock) @@ -187,7 +187,8 @@ void uv_pipe_connect(uv_connect_t* req, * is either there or not. */ do { - r = connect(handle->io_watcher.fd, (struct sockaddr*)&saddr, sizeof saddr); + r = connect(uv__stream_fd(handle), + (struct sockaddr*)&saddr, sizeof saddr); } while (r == -1 && errno == EINTR); @@ -196,7 +197,7 @@ void uv_pipe_connect(uv_connect_t* req, if (new_sock) if (uv__stream_open((uv_stream_t*)handle, - handle->io_watcher.fd, + uv__stream_fd(handle), UV_STREAM_READABLE | UV_STREAM_WRITABLE)) goto out; @@ -233,7 +234,7 @@ static void uv__pipe_accept(uv_loop_t* loop, uv__io_t* w, unsigned int events) { assert(pipe->type == UV_NAMED_PIPE); - sockfd = uv__accept(pipe->io_watcher.fd); + sockfd = uv__accept(uv__stream_fd(pipe)); if (sockfd == -1) { if (errno != EAGAIN && errno != EWOULDBLOCK) { uv__set_sys_error(pipe->loop, errno); |