hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 7ba20a735c71b0795d3d7d9f37c2d1fb4dbec552
parent 9a62f94fc90ce92b4527b92e0e25a6c0d81d636f
Author: Ember Sawady <ecs@d2evs.net>
Date:   Mon, 22 May 2023 16:02:33 +0000

cmd/haredoc: close read end of pipe later

Fixes a nondeterministic SIGPIPE from hare version

Signed-off-by: Ember Sawady <ecs@d2evs.net>

Diffstat:
Mcmd/haredoc/env.ha | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/haredoc/env.ha b/cmd/haredoc/env.ha @@ -34,6 +34,7 @@ fn default_tags() ([]module::tag | error) = { }; let pipe = exec::pipe(); + defer io::close(pipe.0)!; exec::addfile(&cmd, os::stdout_file, pipe.1); let proc = exec::start(&cmd)?; io::close(pipe.1)?; @@ -52,7 +53,6 @@ fn default_tags() ([]module::tag | error) = { break; }; - io::close(pipe.0)?; let status = exec::wait(&proc)?; match (exec::check(&status)) { case void =>