diff options
-rw-r--r-- | run-command.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/run-command.c b/run-command.c index 65ecbe31d..4184e8d9f 100644 --- a/run-command.c +++ b/run-command.c @@ -561,7 +561,12 @@ int finish_command(struct child_process *cmd) int run_command(struct child_process *cmd) { - int code = start_command(cmd); + int code; + + if (cmd->out < 0 || cmd->err < 0) + die("BUG: run_command with a pipe can cause deadlock"); + + code = start_command(cmd); if (code) return code; return finish_command(cmd); |