aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build2/cli/module.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/build2/cli/module.cxx b/build2/cli/module.cxx
index 01d606f..6a6ab38 100644
--- a/build2/cli/module.cxx
+++ b/build2/cli/module.cxx
@@ -116,6 +116,12 @@ namespace build2
if (p != string::npos)
ver = string (ver, p + 1);
+ // Skip until the end as cli doesn't handle writing to the closed
+ // pipe very well (SIGPIPE).
+ //
+ if (is.good ())
+ is.ignore (numeric_limits<streamsize>::max ());
+
is.close (); // Don't block the other end.
if (!pr.wait ())