diff options
-rw-r--r-- | src/subprocess-win32.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/subprocess-win32.cc b/src/subprocess-win32.cc index 2d5c1f0..9fbe03f 100644 --- a/src/subprocess-win32.cc +++ b/src/subprocess-win32.cc @@ -137,6 +137,11 @@ void Subprocess::OnPipeReady() { memset(&overlapped_, 0, sizeof(overlapped_)); if (!::ReadFile(pipe_, overlapped_buf_, sizeof(overlapped_buf_), &bytes, &overlapped_)) { + if (GetLastError() == ERROR_BROKEN_PIPE) { + CloseHandle(pipe_); + pipe_ = NULL; + return; + } if (GetLastError() != ERROR_IO_PENDING) Win32Fatal("ReadFile"); } |