mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
common: Fix gnupg_wait_processes.
* common/exechelp-posix.c (gnupg_wait_processes): Loop for r_exitcodes even if we already see an error. -- Cherry-picked master commit of: eeb3da6eb717ed6a1a1069a7611eb37503e8672d The value stored by waitpid for exit code is encoded; It requires decoded by WEXITSTATUS macro, regardless of an error. For example, when one of processes is already exited and another is still running, it resulted wrong value of in r_exitcodes[n]. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
a09bba976d
commit
6e422b5135
@ -784,30 +784,32 @@ gnupg_wait_processes (const char **pgmnames, pid_t *pids, size_t count,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ec == 0)
|
for (i = 0; i < count; i++)
|
||||||
for (i = 0; i < count; i++)
|
{
|
||||||
{
|
if (r_exitcodes[i] == -1)
|
||||||
if (WIFEXITED (r_exitcodes[i]) && WEXITSTATUS (r_exitcodes[i]) == 127)
|
continue;
|
||||||
{
|
|
||||||
log_error (_("error running '%s': probably not installed\n"),
|
if (WIFEXITED (r_exitcodes[i]) && WEXITSTATUS (r_exitcodes[i]) == 127)
|
||||||
pgmnames[i]);
|
{
|
||||||
ec = GPG_ERR_CONFIGURATION;
|
log_error (_("error running '%s': probably not installed\n"),
|
||||||
}
|
pgmnames[i]);
|
||||||
else if (WIFEXITED (r_exitcodes[i]) && WEXITSTATUS (r_exitcodes[i]))
|
ec = GPG_ERR_CONFIGURATION;
|
||||||
{
|
}
|
||||||
if (dummy)
|
else if (WIFEXITED (r_exitcodes[i]) && WEXITSTATUS (r_exitcodes[i]))
|
||||||
log_error (_("error running '%s': exit status %d\n"),
|
{
|
||||||
pgmnames[i], WEXITSTATUS (r_exitcodes[i]));
|
if (dummy)
|
||||||
else
|
log_error (_("error running '%s': exit status %d\n"),
|
||||||
r_exitcodes[i] = WEXITSTATUS (r_exitcodes[i]);
|
pgmnames[i], WEXITSTATUS (r_exitcodes[i]));
|
||||||
ec = GPG_ERR_GENERAL;
|
else
|
||||||
}
|
r_exitcodes[i] = WEXITSTATUS (r_exitcodes[i]);
|
||||||
else if (!WIFEXITED (r_exitcodes[i]))
|
ec = GPG_ERR_GENERAL;
|
||||||
{
|
}
|
||||||
log_error (_("error running '%s': terminated\n"), pgmnames[i]);
|
else if (!WIFEXITED (r_exitcodes[i]))
|
||||||
ec = GPG_ERR_GENERAL;
|
{
|
||||||
}
|
log_error (_("error running '%s': terminated\n"), pgmnames[i]);
|
||||||
}
|
ec = GPG_ERR_GENERAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
xfree (dummy);
|
xfree (dummy);
|
||||||
return gpg_err_make (GPG_ERR_SOURCE_DEFAULT, ec);
|
return gpg_err_make (GPG_ERR_SOURCE_DEFAULT, ec);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user