diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2012-05-23 04:01:19 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-05-23 04:01:19 +0200 |
commit | 1358bac6d120a750546337ba5e4fe580cdeb81fb (patch) | |
tree | bcf6ed0612cde12c50b8d9c47d308132dadd7bd4 /deps/uv/src/unix/pipe.c | |
parent | dff467d9825a174130bf9379e09b9421d70e3f0d (diff) | |
download | android-node-v8-1358bac6d120a750546337ba5e4fe580cdeb81fb.tar.gz android-node-v8-1358bac6d120a750546337ba5e4fe580cdeb81fb.tar.bz2 android-node-v8-1358bac6d120a750546337ba5e4fe580cdeb81fb.zip |
deps: upgrade libuv to 5b9c451
Diffstat (limited to 'deps/uv/src/unix/pipe.c')
-rw-r--r-- | deps/uv/src/unix/pipe.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/deps/uv/src/unix/pipe.c b/deps/uv/src/unix/pipe.c index 91afb0811e..fb40e9622a 100644 --- a/deps/uv/src/unix/pipe.c +++ b/deps/uv/src/unix/pipe.c @@ -29,6 +29,8 @@ #include <unistd.h> #include <stdlib.h> +static void uv__pipe_accept(uv_loop_t* loop, uv__io_t* w, int events); + int uv_pipe_init(uv_loop_t* loop, uv_pipe_t* handle, int ipc) { uv__stream_init(loop, (uv_stream_t*)handle, UV_NAMED_PIPE); @@ -138,8 +140,11 @@ int uv_pipe_listen(uv_pipe_t* handle, int backlog, uv_connection_cb cb) { uv__set_sys_error(handle->loop, errno); } else { handle->connection_cb = cb; - ev_io_init(&handle->read_watcher, uv__pipe_accept, handle->fd, EV_READ); - ev_io_start(handle->loop->ev, &handle->read_watcher); + uv__io_init(&handle->read_watcher, + uv__pipe_accept, + handle->fd, + UV__IO_READ); + uv__io_start(handle->loop, &handle->read_watcher); } out: @@ -211,8 +216,8 @@ void uv_pipe_connect(uv_connect_t* req, uv__stream_open((uv_stream_t*)handle, sockfd, UV_STREAM_READABLE | UV_STREAM_WRITABLE); - ev_io_start(handle->loop->ev, &handle->read_watcher); - ev_io_start(handle->loop->ev, &handle->write_watcher); + uv__io_start(handle->loop, &handle->read_watcher); + uv__io_start(handle->loop, &handle->write_watcher); status = 0; out: @@ -235,14 +240,14 @@ out: /* TODO merge with uv__server_io()? */ -void uv__pipe_accept(EV_P_ ev_io* watcher, int revents) { +static void uv__pipe_accept(uv_loop_t* loop, uv__io_t* w, int events) { struct sockaddr_un saddr; uv_pipe_t* pipe; int saved_errno; int sockfd; saved_errno = errno; - pipe = watcher->data; + pipe = container_of(w, uv_pipe_t, read_watcher); assert(pipe->type == UV_NAMED_PIPE); @@ -257,7 +262,7 @@ void uv__pipe_accept(EV_P_ ev_io* watcher, int revents) { pipe->connection_cb((uv_stream_t*)pipe, 0); if (pipe->accepted_fd == sockfd) { /* The user hasn't called uv_accept() yet */ - ev_io_stop(pipe->loop->ev, &pipe->read_watcher); + uv__io_stop(pipe->loop, &pipe->read_watcher); } } |