path: root/run-command.c
diff options
authorFrank Li <>2009-09-16 08:20:22 (GMT)
committerJunio C Hamano <>2009-09-19 03:00:42 (GMT)
commit71064e3f86fbf2eb5c2b55a3024051f9542ae229 (patch)
tree9287bbdfe8a2196470fa7d5647f65baf82d6bbc9 /run-command.c
parentd7fa500fb598d725bda3427535e87f06caf93ee8 (diff)
Test for WIN32 instead of __MINGW32_
The code which is conditional on MinGW32 is actually conditional on Windows. Use the WIN32 symbol, which is defined by the MINGW32 and MSVC environments, but not by Cygwin. Define SNPRINTF_SIZE_CORR=1 for MSVC too, as its vsnprintf function does not add NUL at the end of the buffer if the result fits the buffer size exactly. Signed-off-by: Frank Li <> Signed-off-by: Marius Storm-Olsen <> Acked-by: Johannes Sixt <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'run-command.c')
1 files changed, 4 insertions, 4 deletions
diff --git a/run-command.c b/run-command.c
index bb76750..cf2d8f7 100644
--- a/run-command.c
+++ b/run-command.c
@@ -75,7 +75,7 @@ fail_pipe:
trace_argv_printf(cmd->argv, "trace: run_command:");
-#ifndef __MINGW32__
+#ifndef WIN32
cmd->pid = fork();
if (!cmd->pid) {
@@ -315,7 +315,7 @@ int run_command_v_opt_cd_env(const char **argv, int opt, const char *dir, const
return run_command(&cmd);
-#ifdef __MINGW32__
+#ifdef WIN32
static unsigned __stdcall run_thread(void *data)
struct async *async = data;
@@ -331,7 +331,7 @@ int start_async(struct async *async)
return error("cannot create pipe: %s", strerror(errno));
async->out = pipe_out[0];
-#ifndef __MINGW32__
+#ifndef WIN32
/* Flush stdio before fork() to avoid cloning buffers */
@@ -360,7 +360,7 @@ int start_async(struct async *async)
int finish_async(struct async *async)
-#ifndef __MINGW32__
+#ifndef WIN32
int ret = wait_or_whine(async->pid, "child process", 0);
DWORD ret = 0;