Skip to content

Commit 36d5c15

Browse files
committed
add back error handling that was incorrectly dropped by libuv#4030
1 parent 0b271b7 commit 36d5c15

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/unix/pipe.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,22 @@ void uv_pipe_connect(uv_connect_t* req,
206206
uv_pipe_t* handle,
207207
const char* name,
208208
uv_connect_cb cb) {
209-
uv_pipe_connect2(req, handle, name, strlen(name), 0, cb);
209+
int err;
210+
211+
err = uv_pipe_connect2(req, handle, name, strlen(name), 0, cb);
212+
213+
if (err) {
214+
handle->delayed_error = err;
215+
handle->connect_req = req;
216+
217+
uv__req_init(handle->loop, req, UV_CONNECT);
218+
req->handle = (uv_stream_t*)handle;
219+
req->cb = cb;
220+
uv__queue_init(&req->queue);
221+
222+
/* Force callback to run on next tick in case of error. */
223+
uv__io_feed(handle->loop, &handle->io_watcher);
224+
}
210225
}
211226

212227

0 commit comments

Comments
 (0)