summaryrefslogtreecommitdiff
path: root/run-command.c
diff options
context:
space:
mode:
authorAnders Melchiorsen <mail@cup.kalibalik.dk>2008-08-04 10:18:40 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-08-05 04:46:42 (GMT)
commit7d0b18a4da1be9e738293cc13812757ca47ed109 (patch)
tree7dd79690ee16d7af1ccf8a9519c59132599bc35a /run-command.c
parent611921654ffb854338ab758009a93c70054fab7f (diff)
downloadgit-7d0b18a4da1be9e738293cc13812757ca47ed109.zip
git-7d0b18a4da1be9e738293cc13812757ca47ed109.tar.gz
git-7d0b18a4da1be9e738293cc13812757ca47ed109.tar.bz2
Add output flushing before fork()
This adds fflush(NULL) before fork() in start_command(), to keep the generic interface safe. A remaining use of fork() with no flushing is in a comment in show_tree(). Rewrite that comment to use start_command(). Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'run-command.c')
-rw-r--r--run-command.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/run-command.c b/run-command.c
index 6af83c5..bbb9c77 100644
--- a/run-command.c
+++ b/run-command.c
@@ -68,6 +68,7 @@ int start_command(struct child_process *cmd)
trace_argv_printf(cmd->argv, "trace: run_command:");
#ifndef __MINGW32__
+ fflush(NULL);
cmd->pid = fork();
if (!cmd->pid) {
if (cmd->no_stdin)