| 1020 | |
| 1021 | |
| 1022 | int run_command(struct child_process *cmd) |
| 1023 | { |
| 1024 | int code; |
| 1025 | |
| 1026 | if (cmd->out < 0 || cmd->err < 0) |
| 1027 | BUG("run_command with a pipe can cause deadlock"); |
| 1028 | |
| 1029 | code = start_command(cmd); |
| 1030 | if (code) |
| 1031 | return code; |
| 1032 | return finish_command(cmd); |
| 1033 | } |
| 1034 | |
| 1035 | #ifndef NO_PTHREADS |
| 1036 | static pthread_t main_thread; |