aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2021-04-08 01:58:56 +0000
committerNIIBE Yutaka <[email protected]>2021-04-08 02:08:07 +0000
commit956c40f106ead6d0191bc183805021e70c15e760 (patch)
tree781ab6c35650532274cd01fafd4b1309139eecd0
parentbuild: Fix gpgrt-config for handling 'Requires' field. (diff)
downloadlibgpg-error-956c40f106ead6d0191bc183805021e70c15e760.tar.gz
libgpg-error-956c40f106ead6d0191bc183805021e70c15e760.zip
core: Fix gpgrt_wait_processes, by skipping invalid PID.
* src/spawn-posix.c (_gpgrt_wait_processes): Skip invalid PID. -- The API itself is not good to handle multiple processes. Given the API, skipping invalid PID is better for usefulness. GnuPG-bug-id: 5381 Reported-by: Jakub Jelen <[email protected]> Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--src/spawn-posix.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/spawn-posix.c b/src/spawn-posix.c
index ac4c4ce..d33bade 100644
--- a/src/spawn-posix.c
+++ b/src/spawn-posix.c
@@ -703,8 +703,13 @@ _gpgrt_wait_processes (const char **pgmnames, pid_t *pids, size_t count,
{
int status = -1;
+ /* Skip invalid PID. */
if (pids[i] == (pid_t)(-1))
- return 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))