From 1358bac6d120a750546337ba5e4fe580cdeb81fb Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 23 May 2012 04:01:19 +0200 Subject: deps: upgrade libuv to 5b9c451 --- deps/uv/src/unix/pipe.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'deps/uv/src/unix/pipe.c') 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 #include +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); } } -- cgit v1.2.3