From 78dfcf6237400281940a7bd97c05ac18eb69c577 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 16 Jun 2019 14:54:46 -0400 Subject: spawn: Move the pipe FD out of the way of input FDs too --- spawn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spawn.c b/spawn.c index 96c8a1a..18ddd72 100644 --- a/spawn.c +++ b/spawn.c @@ -148,7 +148,7 @@ static void bfs_spawn_exec(const char *exe, const struct bfs_spawn *ctx, char ** for (const struct bfs_spawn_action *action = actions; action; action = action->next) { // Move the error-reporting pipe out of the way if necessary - if (action->out_fd == pipefd[1]) { + if (action->in_fd == pipefd[1] || action->out_fd == pipefd[1]) { int fd = dup(pipefd[1]); if (fd < 0) { goto fail; -- cgit v1.2.3