aboutsummaryrefslogtreecommitdiffstats
path: root/common/exechelp-posix.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2021-04-08 02:26:58 +0000
committerNIIBE Yutaka <[email protected]>2021-04-08 02:26:58 +0000
commitd82dae5d2229a30dbc78aadc4d544d30dac76a1c (patch)
tree8d58fb3b04fb615c69662892d30b84fd3f2cce07 /common/exechelp-posix.c
parentpo: Update Japanese Translation. (diff)
downloadgnupg-d82dae5d2229a30dbc78aadc4d544d30dac76a1c.tar.gz
gnupg-d82dae5d2229a30dbc78aadc4d544d30dac76a1c.zip
common: Fix gnupg_wait_processes, by skipping invalid PID.
* common/exechelp-posix.c (gnupg_wait_processes): Skip invalid PID. -- Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'common/exechelp-posix.c')
-rw-r--r--common/exechelp-posix.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/common/exechelp-posix.c b/common/exechelp-posix.c
index b14410821..77182cb9d 100644
--- a/common/exechelp-posix.c
+++ b/common/exechelp-posix.c
@@ -732,8 +732,13 @@ gnupg_wait_processes (const char **pgmnames, pid_t *pids, size_t count,
{
int status = -1;
+ /* Skip invalid PID. */
if (pids[i] == (pid_t)(-1))
- return my_error (GPG_ERR_INV_VALUE);
+ {
+ r_exitcodes[i] = -1;
+ left -= 1;
+ continue;
+ }
/* See if there was a previously stored result for this pid. */
if (get_result (pids[i], &status))