author | Johannes Sixt <johannes.sixt@telecom.at> | |
Sat, 24 Nov 2007 21:49:16 +0000 (22:49 +0100) | ||
committer | Johannes Sixt <johannes.sixt@telecom.at> | |
Thu, 26 Jun 2008 06:45:10 +0000 (08:45 +0200) | ||
commit | 7e5d776854e858ae69a4cde9db8de6675ffb5de6 | |
tree | 61bf14b4834fc26b869dc83c73dd509cfd43c14c | tree | snapshot |
parent | 746fb8574459798d127e3f9cf782ccb8e31c9e45 | commit | diff |
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>
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>
compat/mingw.c | diff | blob | history | |
compat/mingw.h | diff | blob | history | |
run-command.c | diff | blob | history |