mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
Start the agent on demand if option --enable-standard socket has been
enabled.
This commit is contained in:
parent
830af45ca2
commit
7d0aa53f7f
9 changed files with 262 additions and 129 deletions
|
@ -872,9 +872,11 @@ gnupg_wait_process (const char *pgmname, pid_t pid, int *exitcode)
|
|||
}
|
||||
else if (WIFEXITED (status) && WEXITSTATUS (status))
|
||||
{
|
||||
log_error (_("error running `%s': exit status %d\n"), pgmname,
|
||||
WEXITSTATUS (status));
|
||||
if (exitcode)
|
||||
|
||||
if (!exitcode)
|
||||
log_error (_("error running `%s': exit status %d\n"), pgmname,
|
||||
WEXITSTATUS (status));
|
||||
else
|
||||
*exitcode = WEXITSTATUS (status);
|
||||
ec = GPG_ERR_GENERAL;
|
||||
}
|
||||
|
@ -1002,13 +1004,15 @@ gnupg_spawn_process_detached (const char *pgmname, const char *argv[],
|
|||
}
|
||||
if (!pid)
|
||||
{
|
||||
pid_t pid2;
|
||||
|
||||
gcry_control (GCRYCTL_TERM_SECMEM);
|
||||
if (setsid() == -1 || chdir ("/"))
|
||||
_exit (1);
|
||||
pid = fork (); /* Double fork to let init takes over the new child. */
|
||||
if (pid == (pid_t)(-1))
|
||||
pid2 = fork (); /* Double fork to let init takes over the new child. */
|
||||
if (pid2 == (pid_t)(-1))
|
||||
_exit (1);
|
||||
if (pid)
|
||||
if (pid2)
|
||||
_exit (0); /* Let the parent exit immediately. */
|
||||
|
||||
if (envp)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue