diff options
Diffstat (limited to 'src/spawn-w32.c')
-rw-r--r-- | src/spawn-w32.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/spawn-w32.c b/src/spawn-w32.c index 90c0538..8fecfa6 100644 --- a/src/spawn-w32.c +++ b/src/spawn-w32.c @@ -530,11 +530,14 @@ _gpgrt_spawn_process (const char *pgmname, const char *argv[], return err; if (inpipe[0] == INVALID_HANDLE_VALUE) - nullhd[0] = w32_open_null (0); - if (outpipe[1] == INVALID_HANDLE_VALUE) - nullhd[1] = w32_open_null (1); - if (errpipe[1] == INVALID_HANDLE_VALUE) - nullhd[2] = w32_open_null (1); + nullhd[0] = ((flags & GPGRT_SPAWN_KEEP_STDIN)? + GetStdHandle (STD_INPUT_HANDLE) : w32_open_null (0)); + if (outpipe[1] == INVALID_HANDLE_VALUE) + nullhd[1] = ((flags & GPGRT_SPAWN_KEEP_STDOUT)? + GetStdHandle (STD_OUTPUT_HANDLE) : w32_open_null (1)); + if (errpipe[1] == INVALID_HANDLE_VALUE) + nullhd[2] = ((flags & GPGRT_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. */ |