From e62aef8ebe4b4b7eb733da6822d7759c0427222b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 16 Dec 2015 17:52:15 +0200 Subject: Don't fail if we closed our end of pipe early --- build/cxx/compile.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'build') diff --git a/build/cxx/compile.cxx b/build/cxx/compile.cxx index 72f8562..2a56fbd 100644 --- a/build/cxx/compile.cxx +++ b/build/cxx/compile.cxx @@ -679,7 +679,17 @@ namespace build // We assume the child process issued some diagnostics. // if (!pr.wait ()) - throw failed (); + { + // In case of a restarts, we closed our end of the pipe early + // which might have caused the other end to fail. So far we + // experienced this on Fedora 23 with GCC 5.3.1 and there were + // no diagnostics issued, just the non-zero exit status. If we + // do get diagnostics, then we will have to read and discard the + // output until eof. + // + if (!restart) + throw failed (); + } } catch (const process_error& e) { -- cgit v1.1