diff options
author | Werner Koch <wk@gnupg.org> | 2019-08-05 09:49:09 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2019-08-05 09:49:09 +0200 |
commit | e22ebf357050f98558b428502a565fc3dc256932 (patch) | |
tree | 145cd819b32196ccd892074bb17250f0098bd711 /common/homedir.c | |
parent | common: Change yet unused status_printf function. (diff) | |
download | gnupg2-e22ebf357050f98558b428502a565fc3dc256932.tar.xz gnupg2-e22ebf357050f98558b428502a565fc3dc256932.zip |
common: Remove code duplication for service starting.
* common/homedir.c (gpg_agent_socket_name): New.
* common/asshelp.c (start_new_service): New. Based on
start_new_gpg_agent.
(start_new_gpg_agent): Divert to start_new_service.
(start_new_dirmngr): Ditto.
--
This prepares for adding yet another service starting function.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'common/homedir.c')
-rw-r--r-- | common/homedir.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/common/homedir.c b/common/homedir.c index e9e75d01e..9c680a57f 100644 --- a/common/homedir.c +++ b/common/homedir.c @@ -945,6 +945,17 @@ gnupg_cachedir (void) } +/* Return the standard socket name used by gpg-agent. */ +const char * +gpg_agent_socket_name (void) +{ + static char *name; + + if (!name) + name = make_filename (gnupg_socketdir (), GPG_AGENT_SOCK_NAME, NULL); + return name; +} + /* Return the user socket name used by DirMngr. */ const char * dirmngr_socket_name (void) |