diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2019-06-16 14:54:46 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2019-06-16 15:00:17 -0400 |
commit | 78dfcf6237400281940a7bd97c05ac18eb69c577 (patch) | |
tree | 71e108e2fc948e6e7d1caa5ed4adaa10164f4bcf /spawn.c | |
parent | 3890d79b222709c940330209ff392944e6df860c (diff) | |
download | bfs-78dfcf6237400281940a7bd97c05ac18eb69c577.tar.xz |
spawn: Move the pipe FD out of the way of input FDs too
Diffstat (limited to 'spawn.c')
-rw-r--r-- | spawn.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |