aboutsummaryrefslogtreecommitdiffstats
path: root/common/exechelp-w32.c
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-01-20 11:13:35 +0000
committerJustus Winter <[email protected]>2016-02-23 10:58:20 +0000
commit8857590006266da200427f2d4f9e8c27fbc89ed9 (patch)
tree3f4354a3d847c9b903bb456a2fa67ddd13aa6349 /common/exechelp-w32.c
parentcommon/exechelp: Fix error handling. (diff)
downloadgnupg-8857590006266da200427f2d4f9e8c27fbc89ed9.tar.gz
gnupg-8857590006266da200427f2d4f9e8c27fbc89ed9.zip
common/exechelp: Fix opening the 'nul' device.
* common/exechelp-w32.c (gnupg_spawn_process): Fix opening the 'nul' device. Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'common/exechelp-w32.c')
-rw-r--r--common/exechelp-w32.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/common/exechelp-w32.c b/common/exechelp-w32.c
index 1b3d072ce..e01be64d7 100644
--- a/common/exechelp-w32.c
+++ b/common/exechelp-w32.c
@@ -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. */