common/exechelp: Fix opening the 'nul' device.

* common/exechelp-w32.c (gnupg_spawn_process): Fix opening the 'nul'
device.

Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
Justus Winter 2016-01-20 12:13:35 +01:00
parent f5a4b6a3a3
commit 8857590006
1 changed files with 5 additions and 5 deletions

View File

@ -483,12 +483,12 @@ gnupg_spawn_process (const char *pgmname, const char *argv[],
if (err)
return err;
if (inpipe[0] != INVALID_HANDLE_VALUE)
if (inpipe[0] == INVALID_HANDLE_VALUE)
nullhd[0] = w32_open_null (0);
if (outpipe[1] != INVALID_HANDLE_VALUE)
nullhd[1] = w32_open_null (0);
if (errpipe[1] != INVALID_HANDLE_VALUE)
nullhd[2] = 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);
/* Start the process. Note that we can't run the PREEXEC function
because this might change our own environment. */