summaryrefslogtreecommitdiff
path: root/deps/uv/src/win/process-stdio.c
diff options
context:
space:
mode:
Diffstat (limited to 'deps/uv/src/win/process-stdio.c')
-rw-r--r--deps/uv/src/win/process-stdio.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/deps/uv/src/win/process-stdio.c b/deps/uv/src/win/process-stdio.c
index 51c56b225..612f6be9a 100644
--- a/deps/uv/src/win/process-stdio.c
+++ b/deps/uv/src/win/process-stdio.c
@@ -104,12 +104,16 @@ static int uv__create_stdio_pipe_pair(uv_loop_t* loop,
int err;
if (flags & UV_READABLE_PIPE) {
- server_access |= PIPE_ACCESS_OUTBOUND;
+ /* The server needs inbound access too, otherwise CreateNamedPipe() */
+ /* won't give us the FILE_READ_ATTRIBUTES permission. We need that to */
+ /* probe the state of the write buffer when we're trying to shutdown */
+ /* the pipe. */
+ server_access |= PIPE_ACCESS_OUTBOUND | PIPE_ACCESS_INBOUND;
client_access |= GENERIC_READ | FILE_WRITE_ATTRIBUTES;
}
if (flags & UV_WRITABLE_PIPE) {
server_access |= PIPE_ACCESS_INBOUND;
- client_access |= GENERIC_WRITE;
+ client_access |= GENERIC_WRITE | FILE_READ_ATTRIBUTES;
}
/* Create server pipe handle. */
@@ -163,8 +167,11 @@ static int uv__create_stdio_pipe_pair(uv_loop_t* loop,
}
}
- /* The server end is now readable and writable. */
- server_pipe->flags |= UV_HANDLE_READABLE | UV_HANDLE_WRITABLE;
+ /* The server end is now readable and/or writable. */
+ if (flags & UV_READABLE_PIPE)
+ server_pipe->flags |= UV_HANDLE_WRITABLE;
+ if (flags & UV_WRITABLE_PIPE)
+ server_pipe->flags |= UV_HANDLE_READABLE;
*child_pipe_ptr = child_pipe;
return 0;