Skip to content

Commit b454a76

Browse files
theanarkhjuanarbol
authored andcommitted
src: keep PipeWrap::Open function consistent with TCPWrap
PR-URL: #46064 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 5539977 commit b454a76

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/pipe_wrap.cc

+2-3
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,9 @@ 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) wrap->set_fd(fd);
221221

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

226225

0 commit comments

Comments
 (0)