Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: ignore ENOTCONN on shutdown race with child #1214

Merged
merged 1 commit into from
Mar 28, 2015
Merged
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 @@ -321,6 +321,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