aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-11-24 13:32:05 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-11-24 13:32:05 +0300
commitb90393fdce6223405b8c144e3a9617a5e82e6e78 (patch)
tree1a157c4e1d6f59ebdf31b043fdc9372659a7c968
parent830240bc527331c9b4998810b50a3cd6c57f9f60 (diff)
Fix script to pass diag buffer reading end to process constructor
-rw-r--r--libbuild2/script/run.cxx17
1 files changed, 7 insertions, 10 deletions
diff --git a/libbuild2/script/run.cxx b/libbuild2/script/run.cxx
index 550fdc1..7b08898 100644
--- a/libbuild2/script/run.cxx
+++ b/libbuild2/script/run.cxx
@@ -2067,15 +2067,6 @@ namespace build2
if (diag_buffer::pipe (env.context) == -1) // Are we buffering?
p = fdopen_pipe ();
- // @@ TODO: perhaps this lambda should return process::pipe?
- // (see the simple test rule implementatio for an
- // example).
- //
- // Note that we must return non-owning fd to our end of the
- // pipe (see the process class for details).
- //
- // process::pipe r (p.in.get (), move (p.out));
-
// Deduce the args0 argument similar to cmd_path().
//
// Note that we must open the diag buffer regardless of the
@@ -2915,10 +2906,16 @@ namespace build2
if (verb >= 2)
print_process (pe, args);
+ // Note that stderr can only be a pipe if we are buffering the
+ // diagnostics. In this case also pass the reading end so it can be
+ // "probed" on Windows (see butl::process::pipe for details).
+ //
process pr (
*pe.path,
args.data (),
- {ifd.get (), -1}, process::pipe (ofd), {-1, efd.get ()},
+ {ifd.get (), -1},
+ process::pipe (ofd),
+ {pc.dbuf.is.fd (), efd.get ()},
cwd.string ().c_str (),
pe.vars);