mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
gpgconf: Exit with failure if --launch fails.
* tools/gpgconf-comp.c (gc_component_launch): Return an error code. * tools/gpgconf.c (main): Exit if launch failed. -- GnuPG-bug-id: 1791
This commit is contained in:
parent
b1b1923b06
commit
5cb6df8996
@ -1142,7 +1142,7 @@ dirmngr_runtime_change (int killflag)
|
|||||||
|
|
||||||
|
|
||||||
/* Launch the gpg-agent or the dirmngr if not already running. */
|
/* Launch the gpg-agent or the dirmngr if not already running. */
|
||||||
void
|
gpg_error_t
|
||||||
gc_component_launch (int component)
|
gc_component_launch (int component)
|
||||||
{
|
{
|
||||||
gpg_error_t err;
|
gpg_error_t err;
|
||||||
@ -1176,6 +1176,7 @@ gc_component_launch (int component)
|
|||||||
" NOP",
|
" NOP",
|
||||||
gpg_strerror (err));
|
gpg_strerror (err));
|
||||||
gnupg_release_process (pid);
|
gnupg_release_process (pid);
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -281,9 +281,17 @@ main (int argc, char **argv)
|
|||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
else if (cmd == aLaunch)
|
else if (cmd == aLaunch)
|
||||||
gc_component_launch (idx);
|
{
|
||||||
|
if (gc_component_launch (idx))
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
gc_component_kill (idx);
|
{
|
||||||
|
/* We don't error out if the kill failed because this
|
||||||
|
command should do nothing if the component is not
|
||||||
|
running. */
|
||||||
|
gc_component_kill (idx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ char *gc_percent_escape (const char *src);
|
|||||||
void gc_error (int status, int errnum, const char *fmt, ...);
|
void gc_error (int status, int errnum, const char *fmt, ...);
|
||||||
|
|
||||||
/* Launch given component. */
|
/* Launch given component. */
|
||||||
void gc_component_launch (int component);
|
gpg_error_t gc_component_launch (int component);
|
||||||
|
|
||||||
/* Kill given component. */
|
/* Kill given component. */
|
||||||
void gc_component_kill (int component);
|
void gc_component_kill (int component);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user