Skip to content

Commit de44085

Browse files
committed
src: keep the return value of PipeWrap::Open function consistent with TCPWrap
1 parent 28fe494 commit de44085

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/pipe_wrap.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,10 @@ void PipeWrap::Open(const FunctionCallbackInfo<Value>& args) {
217217
if (!args[0]->Int32Value(env->context()).To(&fd)) return;
218218

219219
int err = uv_pipe_open(&wrap->handle_, fd);
220-
wrap->set_fd(fd);
220+
if (err == 0)
221+
wrap->set_fd(fd);
221222

222-
if (err != 0)
223-
env->ThrowUVException(err, "uv_pipe_open");
223+
args.GetReturnValue().Set(err);
224224
}
225225

226226

0 commit comments

Comments
 (0)