diff options
author | NIIBE Yutaka <[email protected]> | 2022-10-19 05:10:03 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2022-10-19 05:10:03 +0000 |
commit | 494886acb0bf3d536f4e620340e42c8ec8947742 (patch) | |
tree | 7896f5e3692b0b685c1acc77847b6eeed9502766 /src/spawn-w32.c | |
parent | build: Remove potomo from repo. (diff) | |
download | libgpg-error-494886acb0bf3d536f4e620340e42c8ec8947742.tar.gz libgpg-error-494886acb0bf3d536f4e620340e42c8ec8947742.zip |
spawn: Update changes from gnupg.
* src/gpg-error.h.in (GPGRT_SPAWN_KEEP_STDIN): New.
(GPGRT_SPAWN_KEEP_STDOUT, GPGRT_SPAWN_KEEP_STDERR): New.
* src/gpgrt-int.h: Add comment.
* src/spawn-posix.c (do_exec): Add the argument FLAGS.
(_gpgrt_spawn_process): Add FLAGS.
(_gpgrt_spawn_process_fd): Follow the change.
(_gpgrt_spawn_process_detached): Likewise.
* src/spawn-w32.c (_gpgrt_spawn_process): Handle FLAGS.
--
This commit imports GnuPG master commit of:
6d6438a361d25f3b269f702e017f5e39fd1f5c38
GnuPG-bug-id: 6249
Signed-off-by: NIIBE Yutaka <[email protected]>
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. */ |