aboutsummaryrefslogtreecommitdiff
path: root/run-command.c
diff options
context:
space:
mode:
authorFrank Li <lznuaa@gmail.com>2009-09-16 10:20:17 +0200
committerJunio C Hamano <gitster@pobox.com>2009-09-18 20:00:41 -0700
commit0d30ad71fa094dd89ae31b3381c2e63a41119c76 (patch)
tree83d47d51f0d0598e9cea631273b4cdd317957abc /run-command.c
parent812bdbc31b246fcd5f3293e4dbac27eaec1ef4fa (diff)
downloadgit-0d30ad71fa094dd89ae31b3381c2e63a41119c76.tar.gz
git-0d30ad71fa094dd89ae31b3381c2e63a41119c76.tar.xz
Avoid declaration after statement
MSVC does not understand this C99 style. Signed-off-by: Frank Li <lznuaa@gmail.com> Signed-off-by: Marius Storm-Olsen <mstormo@gmail.com> Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'run-command.c')
-rw-r--r--run-command.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/run-command.c b/run-command.c
index ac314a5a8..02aaedfb8 100644
--- a/run-command.c
+++ b/run-command.c
@@ -134,6 +134,7 @@ fail_pipe:
error("cannot fork() for %s: %s", cmd->argv[0],
strerror(failed_errno = errno));
#else
+{
int s0 = -1, s1 = -1, s2 = -1; /* backups of stdin, stdout, stderr */
const char **sargv = cmd->argv;
char **env = environ;
@@ -197,6 +198,7 @@ fail_pipe:
dup2(s1, 1), close(s1);
if (s2 >= 0)
dup2(s2, 2), close(s2);
+}
#endif
if (cmd->pid < 0) {