1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

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.
This commit is contained in:
Werner Koch 2022-03-15 09:33:09 +01:00
parent d94b411f12
commit 6d6438a361
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
3 changed files with 29 additions and 9 deletions

View file

@ -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. */