Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

src: ignore ENOTCONN on shutdown race with child #14480

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/spawn_sync.cc
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,14 @@ void SyncProcessStdioPipe::WriteCallback(uv_write_t* req, int result) {
void SyncProcessStdioPipe::ShutdownCallback(uv_shutdown_t* req, int result) {
SyncProcessStdioPipe* self =
reinterpret_cast<SyncProcessStdioPipe*>(req->handle->data);

// On AIX, OS X and the BSDs, calling shutdown() on one end of a pipe
// when the other end has closed the connection fails with ENOTCONN.
// Libuv is not the right place to handle that because it can't tell
// if the error is genuine but we here can.
if (result == UV_ENOTCONN)
result = 0;

self->OnShutdownDone(result);
}

Expand Down