summaryrefslogtreecommitdiffstats
path: root/common/homedir.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2019-08-05 09:49:09 +0200
committerWerner Koch <wk@gnupg.org>2019-08-05 09:49:09 +0200
commite22ebf357050f98558b428502a565fc3dc256932 (patch)
tree145cd819b32196ccd892074bb17250f0098bd711 /common/homedir.c
parentcommon: Change yet unused status_printf function. (diff)
downloadgnupg2-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.c11
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)