diff options
Diffstat (limited to 'common/exechelp-w32.c')
-rw-r--r-- | common/exechelp-w32.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/common/exechelp-w32.c b/common/exechelp-w32.c index 9ca2bab2d..1c4b8ac36 100644 --- a/common/exechelp-w32.c +++ b/common/exechelp-w32.c @@ -1224,7 +1224,8 @@ gnupg_process_spawn (const char *pgmname, const char *argv[], check_syscall_func (); - *r_process = NULL; + if (r_process) + *r_process = NULL; /* Build the command line. */ ec = build_w32_commandline (pgmname, argv, &cmdline); @@ -1486,6 +1487,13 @@ gnupg_process_spawn (const char *pgmname, const char *argv[], process->exitcode = -1; process->terminated = 0; + if (r_process == NULL) + { + ec = gnupg_process_wait (process, 1); + gnupg_process_release (process); + return ec; + } + *r_process = process; return 0; } |