Skip to content

Commit

Permalink
win pipe: fix duplication logic error
Browse files Browse the repository at this point in the history
it does little good to duplicate the pipe handle to protect against errors and then not use the new handle
(ref 41af332)
vtjnash committed Jul 16, 2015
1 parent bd8cf2a commit 0ada24a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/win/pipe.c
Original file line number Diff line number Diff line change
@@ -2061,14 +2061,13 @@ int uv_pipe_open(uv_pipe_t* pipe, uv_file file) {
}
}

if (os_handle == INVALID_HANDLE_VALUE ||
if (os_handle2 == INVALID_HANDLE_VALUE ||
uv_set_pipe_handle(pipe->loop, pipe, os_handle2, 0) == -1) {
return UV_EINVAL;
}

uv_pipe_connection_init(pipe);

pipe->handle = os_handle;
if (access.AccessFlags&FILE_WRITE_DATA)
pipe->flags |= UV_HANDLE_WRITABLE;
if (access.AccessFlags&FILE_READ_DATA)

0 comments on commit 0ada24a

Please sign in to comment.