summaryrefslogtreecommitdiff
path: root/run-command.c
diff options
context:
space:
mode:
authorJohannes Sixt <johannes.sixt@telecom.at>2007-11-24 21:49:16 (GMT)
committerJohannes Sixt <johannes.sixt@telecom.at>2008-06-26 06:45:10 (GMT)
commit7e5d776854e858ae69a4cde9db8de6675ffb5de6 (patch)
tree61bf14b4834fc26b869dc83c73dd509cfd43c14c /run-command.c
parent746fb8574459798d127e3f9cf782ccb8e31c9e45 (diff)
downloadgit-7e5d776854e858ae69a4cde9db8de6675ffb5de6.zip
git-7e5d776854e858ae69a4cde9db8de6675ffb5de6.tar.gz
git-7e5d776854e858ae69a4cde9db8de6675ffb5de6.tar.bz2
Windows: Implement a custom spawnve().
The problem with Windows's own implementation is that it tries to be clever when a console program is invoked from a GUI application: In this case it sometimes automatically allocates a new console window. As a consequence, the IO channels of the spawned program are directed to the console, but the invoking application listens on channels that are now directed to nowhere. In this implementation we use the lowlevel facilities of CreateProcess(), which offers a flag to tell the system not to open a console. As a side effect, only stdin, stdout, and stderr channels will be accessible from C programs that are spawned. Other channels (file handles, pipe handles, etc.) are still inherited by the spawned program, but it doesn't get enough information to access them. Johannes Schindelin integrated path quoting and unified the various *execv* and *spawnv* helpers. Eric Raible suggested to also quote '{'. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Diffstat (limited to 'run-command.c')
-rw-r--r--run-command.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/run-command.c b/run-command.c
index 63238e4..2ce8c2b 100644
--- a/run-command.c
+++ b/run-command.c
@@ -168,7 +168,7 @@ int start_command(struct child_process *cmd)
cmd->argv[0] = git_cmd.buf;
}
- cmd->pid = spawnvpe(_P_NOWAIT, cmd->argv[0], cmd->argv, (const char **)env);
+ cmd->pid = mingw_spawnvpe(cmd->argv[0], cmd->argv, env);
if (cmd->env)
free_environ(env);