diff options
author | Evan Martin <martine@danga.com> | 2011-06-25 20:16:43 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-06-25 20:16:43 (GMT) |
commit | cdb981e337297da7046e4daa5c2e055bf6b8d95b (patch) | |
tree | b220b071da6c9ece3b3b3b684b3845db3ac7a120 | |
parent | 104be5c9ff08cda68496e586a1385574cc5e08b9 (diff) | |
download | Ninja-cdb981e337297da7046e4daa5c2e055bf6b8d95b.zip Ninja-cdb981e337297da7046e4daa5c2e055bf6b8d95b.tar.gz Ninja-cdb981e337297da7046e4daa5c2e055bf6b8d95b.tar.bz2 |
Fix for 'pipe has ended' errors on Win32 distributed builds
Patch from John Birtley.
-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"); } |