aboutsummaryrefslogtreecommitdiffstats
path: root/common/asshelp.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2013-11-18 13:09:47 +0000
committerWerner Koch <[email protected]>2013-11-18 13:09:47 +0000
commitcc9a0b69b698ba436eaf777e5020532845b56236 (patch)
treecb2274c3d97fffa7020cb1e5a56373935ee094b2 /common/asshelp.c
parentAdd strusage macro replacement feature. (diff)
downloadgnupg-cc9a0b69b698ba436eaf777e5020532845b56236.tar.gz
gnupg-cc9a0b69b698ba436eaf777e5020532845b56236.zip
Make use of the *_NAME etc macros.
Replace hardwired strings at many places with new macros from config.h and use the new strusage macro replacement feature. * common/asshelp.c (lock_spawning) [W32]: Change the names of the spawn sentinels. * agent/command.c (cmd_import_key): Use asprintf to create the prompt.
Diffstat (limited to 'common/asshelp.c')
-rw-r--r--common/asshelp.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/common/asshelp.c b/common/asshelp.c
index fe328549b..cfbc3ac16 100644
--- a/common/asshelp.c
+++ b/common/asshelp.c
@@ -265,9 +265,9 @@ lock_spawning (lock_spawn_t *lock, const char *homedir, const char *name,
*lock = CreateMutexW
(NULL, FALSE,
- !strcmp (name, "agent")? L"GnuPG_spawn_agent_sentinel":
- !strcmp (name, "dirmngr")? L"GnuPG_spawn_dirmngr_sentinel":
- /* */ L"GnuPG_spawn_unknown_sentinel");
+ !strcmp (name, "agent")? L"spawn_"GNUPG_NAME"_agent_sentinel":
+ !strcmp (name, "dirmngr")? L"spawn_"GNUPG_NAME"_dirmngr_sentinel":
+ /* */ L"spawn_"GNUPG_NAME"_unknown_sentinel");
if (!*lock)
{
log_error ("failed to create the spawn_%s mutex: %s\n",
@@ -378,7 +378,7 @@ start_new_gpg_agent (assuan_context_t *r_ctx,
}
restart:
- infostr = force_pipe_server? NULL : getenv ("GPG_AGENT_INFO");
+ infostr = force_pipe_server? NULL : getenv (GPG_AGENT_INFO_NAME);
if (!infostr || !*infostr)
{
char *sockname;
@@ -388,7 +388,7 @@ start_new_gpg_agent (assuan_context_t *r_ctx,
/* First check whether we can connect at the standard
socket. */
- sockname = make_filename (homedir, "S.gpg-agent", NULL);
+ sockname = make_filename (homedir, GPG_AGENT_SOCK_NAME, NULL);
err = assuan_socket_connect (ctx, sockname, 0, 0);
if (err)
@@ -517,7 +517,8 @@ start_new_gpg_agent (assuan_context_t *r_ctx,
infostr = xstrdup (infostr);
if ( !(p = strchr (infostr, PATHSEP_C)) || p == infostr)
{
- log_error (_("malformed GPG_AGENT_INFO environment variable\n"));
+ log_error (_("malformed %s environment variable\n"),
+ GPG_AGENT_INFO_NAME);
xfree (infostr);
force_pipe_server = 1;
goto restart;