aboutsummaryrefslogtreecommitdiffstats
path: root/common/exechelp-w32.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2022-03-15 08:33:09 +0000
committerWerner Koch <[email protected]>2022-03-18 10:14:54 +0000
commit6d6438a361d25f3b269f702e017f5e39fd1f5c38 (patch)
treec44dbcafde60dfaa1bd49cad9ef456246dd0eaf8 /common/exechelp-w32.c
parentcommon: Fix a race condition removing stale lockfile. (diff)
downloadgnupg-6d6438a361d25f3b269f702e017f5e39fd1f5c38.tar.gz
gnupg-6d6438a361d25f3b269f702e017f5e39fd1f5c38.zip
common: New flags for gnupg_spawn_process
* common/exechelp.h (GNUPG_SPAWN_KEEP_STDIN): New. (GNUPG_SPAWN_KEEP_STDOUT): New. (GNUPG_SPAWN_KEEP_STDERR): New. * common/exechelp-posix.c (do_exec): Add arg flags and implement new flags. * common/exechelp-w32.c (gnupg_spawn_process): Implement new flags.
Diffstat (limited to 'common/exechelp-w32.c')
-rw-r--r--common/exechelp-w32.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/common/exechelp-w32.c b/common/exechelp-w32.c
index dee96f5b4..9529c57a0 100644
--- a/common/exechelp-w32.c
+++ b/common/exechelp-w32.c
@@ -556,11 +556,14 @@ gnupg_spawn_process (const char *pgmname, const char *argv[],
return err;
if (inpipe[0] == INVALID_HANDLE_VALUE)
- nullhd[0] = w32_open_null (0);
+ nullhd[0] = ((flags & GNUPG_SPAWN_KEEP_STDIN)?
+ GetStdHandle (STD_INPUT_HANDLE) : w32_open_null (0));
if (outpipe[1] == INVALID_HANDLE_VALUE)
- nullhd[1] = w32_open_null (1);
+ nullhd[1] = ((flags & GNUPG_SPAWN_KEEP_STDOUT)?
+ GetStdHandle (STD_OUTPUT_HANDLE) : w32_open_null (1));
if (errpipe[1] == INVALID_HANDLE_VALUE)
- nullhd[2] = w32_open_null (1);
+ nullhd[2] = ((flags & GNUPG_SPAWN_KEEP_STDOUT)?
+ GetStdHandle (STD_ERROR_HANDLE) : w32_open_null (1));
/* Start the process. Note that we can't run the PREEXEC function
because this might change our own environment. */