From 7d0b18a4da1be9e738293cc13812757ca47ed109 Mon Sep 17 00:00:00 2001 From: Anders Melchiorsen Date: Mon, 4 Aug 2008 12:18:40 +0200 Subject: 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 Signed-off-by: Junio C Hamano --- run-command.c | 1 + 1 file changed, 1 insertion(+) (limited to 'run-command.c') diff --git a/run-command.c b/run-command.c index 6af83c526..bbb9c777e 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) -- cgit v1.2.1