aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-06-29 14:34:40 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-07-01 15:47:01 +0300
commit9bd06458e869ab0b41db2d3d7b190d6183ff8547 (patch)
treed843296f9e70eeb5b1a82a6b5669e6699cba5755
parentec7b7e37ce97d25adc209befb2c12cf16eb06ef1 (diff)
Fix cli test to read cli output till the end
-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 ())