diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/gpgconf-comp.c | 21 | ||||
-rw-r--r-- | tools/gpgconf.c | 14 |
2 files changed, 32 insertions, 3 deletions
diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c index 2dcf0758e..300f63da6 100644 --- a/tools/gpgconf-comp.c +++ b/tools/gpgconf-comp.c @@ -1263,6 +1263,14 @@ gc_component_launch (int component) int i; pid_t pid; + if (component < 0) + { + err = gc_component_launch (GC_COMPONENT_GPG_AGENT); + if (!err) + err = gc_component_launch (GC_COMPONENT_DIRMNGR); + return err; + } + if (!(component == GC_COMPONENT_GPG_AGENT || component == GC_COMPONENT_DIRMNGR)) { @@ -1304,7 +1312,16 @@ gc_component_kill (int component) for (backend = 0; backend < GC_BACKEND_NR; backend++) runtime[backend] = 0; - if (component >= 0) + if (component < 0) + { + for (component = 0; component < GC_COMPONENT_NR; component++) + { + option = gc_component[component].options; + for (; option && option->name; option++) + runtime[option->backend] = 1; + } + } + else { assert (component < GC_COMPONENT_NR); option = gc_component[component].options; @@ -1333,7 +1350,7 @@ gc_component_reload (int component) for (backend = 0; backend < GC_BACKEND_NR; backend++) runtime[backend] = 0; - if (component == -1) + if (component < 0) { for (component = 0; component < GC_COMPONENT_NR; component++) { diff --git a/tools/gpgconf.c b/tools/gpgconf.c index a1034e663..c69b1c3e2 100644 --- a/tools/gpgconf.c +++ b/tools/gpgconf.c @@ -589,6 +589,18 @@ main (int argc, char **argv) es_putc ('\n', es_stderr); exit (2); } + else if (!strcmp (fname, "all")) + { + if (cmd == aLaunch) + { + if (gc_component_launch (-1)) + exit (1); + } + else + { + gc_component_kill (-1); + } + } else { /* Launch/Kill a given component. */ @@ -617,7 +629,7 @@ main (int argc, char **argv) break; case aReload: - if (!fname) + if (!fname || !strcmp (fname, "all")) { /* Reload all. */ gc_component_reload (-1); |