aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2024-06-04 02:19:27 +0000
committerNIIBE Yutaka <[email protected]>2024-06-04 02:19:27 +0000
commit3be8b2c95faac8543e2ceddb308b8c138dde11d8 (patch)
tree6cd3cd7ba3be2272f0c20410c5386a75ce53b4e0
parentspawn: Allow NULL for ACT. (diff)
downloadlibgpg-error-3be8b2c95faac8543e2ceddb308b8c138dde11d8.tar.gz
libgpg-error-3be8b2c95faac8543e2ceddb308b8c138dde11d8.zip
spawn:w32: Fix setting of dwFlags for CreateProcess.
* src/spawn-w32.c (_gpgrt_process_spawn): Only set STARTF_USESTDHANDLES with active handles. -- Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--src/spawn-w32.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/spawn-w32.c b/src/spawn-w32.c
index 139a71f..1c0daa9 100644
--- a/src/spawn-w32.c
+++ b/src/spawn-w32.c
@@ -774,7 +774,8 @@ _gpgrt_process_spawn (const char *pgmname, const char *argv[],
/* Start the process. */
si.StartupInfo.cb = sizeof (si);
- si.StartupInfo.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
+ si.StartupInfo.dwFlags = ((i > 0 ? STARTF_USESTDHANDLES : 0)
+ | STARTF_USESHOWWINDOW);
si.StartupInfo.wShowWindow = DEBUG_W32_SPAWN? SW_SHOW : SW_HIDE;
si.StartupInfo.hStdInput = act->hd[0];
si.StartupInfo.hStdOutput = act->hd[1];