src: keep PipeWrap::Open function consistent with TCPWrap

PR-URL: https://github.com/nodejs/node/pull/46064
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
theanarkh authored and RafaelGSS committed 2023-01-19 22:13:10 -03:00
1 parent a42fc512b6
commit ca8ff08a5c
1 file changed
+2 -3
+2 -3
View File
@@ -217,10 +217,9 @@ void PipeWrap::Open(const FunctionCallbackInfo<Value>& args) {
if (!args[0]->Int32Value(env->context()).To(&fd)) return;
int err = uv_pipe_open(&wrap->handle_, fd);
wrap->set_fd(fd);
if (err == 0) wrap->set_fd(fd);
if (err != 0)
env->ThrowUVException(err, "uv_pipe_open");
args.GetReturnValue().Set(err);
}