summaryrefslogtreecommitdiff
path: root/run-command.c
diff options
context:
space:
mode:
Diffstat (limited to 'run-command.c')
-rw-r--r--run-command.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/run-command.c b/run-command.c
index 65ecbe31d7..4184e8d9f3 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);