GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: handle errors from uv_pipe_connect2() · nodejs/node@c253e39

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • pipe_wrap.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/pipe_wrap.cc‎

Copy file name to clipboardExpand all lines: src/pipe_wrap.cc
+11-8Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,16 +225,19 @@ void PipeWrap::Connect(const FunctionCallbackInfo<Value>& args) {
225225

226226
ConnectWrap* req_wrap =
227227
new ConnectWrap(env, req_wrap_obj, AsyncWrap::PROVIDER_PIPECONNECTWRAP);
228-
req_wrap->Dispatch(
228+
int err = req_wrap->Dispatch(
229229
uv_pipe_connect2, &wrap->handle_, *name, name.length(), 0, AfterConnect);
230+
if (err) {
231+
delete req_wrap;
232+
} else {
233+
TRACE_EVENT_NESTABLE_ASYNC_BEGIN1(TRACING_CATEGORY_NODE2(net, native),
234+
"connect",
235+
req_wrap,
236+
"pipe_path",
237+
TRACE_STR_COPY(*name));
238+
}
230239

231-
TRACE_EVENT_NESTABLE_ASYNC_BEGIN1(TRACING_CATEGORY_NODE2(net, native),
232-
"connect",
233-
req_wrap,
234-
"pipe_path",
235-
TRACE_STR_COPY(*name));
236-
237-
args.GetReturnValue().Set(0); // uv_pipe_connect() doesn't return errors.
240+
args.GetReturnValue().Set(err);
238241
}
239242

240243
} // namespace node

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.