diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2016-06-29 14:34:40 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2016-07-01 15:47:01 +0300 |
commit | 9bd06458e869ab0b41db2d3d7b190d6183ff8547 (patch) | |
tree | d843296f9e70eeb5b1a82a6b5669e6699cba5755 | |
parent | ec7b7e37ce97d25adc209befb2c12cf16eb06ef1 (diff) |
Fix cli test to read cli output till the end
-rw-r--r-- | build2/cli/module.cxx | 6 |
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 ()) |