diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-04-24 02:36:37 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-04-24 02:36:37 -0700 |
commit | 51a388d7ff1af7b6f6fa37918134625df4f11976 (patch) | |
tree | bb292e2492609d76c353a535b9c5443cdfc1473d | |
parent | a16d9a4f16a9089f1cbafc287ec2c43aa9091717 (diff) | |
download | txr-51a388d7ff1af7b6f6fa37918134625df4f11976.tar.gz txr-51a388d7ff1af7b6f6fa37918134625df4f11976.tar.bz2 txr-51a388d7ff1af7b6f6fa37918134625df4f11976.zip |
subprocesses: don't unnecessarily flush *stdout*.
* stream.c (open_subprocess, open_commad): Only flush standard
output for non-input pipes. If we are capturing the output of
the process, then it is unrelated to our standard output.
-rw-r--r-- | stream.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -4432,7 +4432,8 @@ static val open_subprocess(val name, val mode_str, val args, val fun) if (!name && !fun) uw_throwf(error_s, lit("~a: program name and/or function required"), self, nao); - flush_stream(std_output); + if (!input) + flush_stream(std_output); fds_init(&sfds); @@ -4601,7 +4602,8 @@ val open_command(val path, val mode_str) FILE *f = 0; int fds_flags = (input ? FDS_IN : FDS_OUT) | FDS_ERR; - flush_stream(std_output); + if (!input) + flush_stream(std_output); fds_init(&sfds); |