From a2d9e48fcca6cfc2dfadef6dbd3579a30314676b Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Mon, 2 Jan 2012 22:15:00 +0100 Subject: Only set gcrypt thread callback for older version of gcrypt. * agent/gpg-agent.c, dirmngr/dirmngr.c, g13/g13.c, scd/scdaemon.c (USE_GCRY_THREAD_CBS): New macro, defined if GCRY_THREAD_OPTION_VERSION is 0. (fixed_gcry_pth_init) [!USE_GCRY_THREAD_CBS]: Don't define. (main) [!USE_GCRY_THREAD_CBS]: Do not install thread callbacks. --- dirmngr/dirmngr.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'dirmngr/dirmngr.c') diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c index e1bae7ea3..7d478b373 100644 --- a/dirmngr/dirmngr.c +++ b/dirmngr/dirmngr.c @@ -280,11 +280,17 @@ static void handle_connections (assuan_fd_t listen_fd); /* Pth wrapper function definitions. */ ASSUAN_SYSTEM_PTH_IMPL; +#if GCRY_THREAD_OPTION_VERSION == 0 +#define FIX_GCRY_PTH_INIT 1 +#endif + +#ifdef FIX_GCRY_PTH_INIT GCRY_THREAD_OPTION_PTH_IMPL; static int fixed_gcry_pth_init (void) { return pth_self ()? 0 : (pth_init () == FALSE) ? errno : 0; } +#endif #ifndef PTH_HAVE_PTH_THREAD_ID static unsigned long pth_thread_id (void) @@ -618,6 +624,7 @@ main (int argc, char **argv) i18n_init (); init_common_subsystems (&argc, &argv); +#ifdef USE_GCRY_THREAD_CBS /* Libgcrypt requires us to register the threading model first. Note that this will also do the pth_init. */ gcry_threads_pth.init = fixed_gcry_pth_init; @@ -627,6 +634,7 @@ main (int argc, char **argv) log_fatal ("can't register GNU Pth with Libgcrypt: %s\n", gpg_strerror (rc)); } +#endif gcry_control (GCRYCTL_DISABLE_SECMEM, 0); /* Check that the libraries are suitable. Do it here because -- cgit v1.2.3 From 682df45d15661ed3544e2ed34bcb636200cc40f9 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 3 Jan 2012 11:14:14 +0100 Subject: Terminate csh commands with a semicolon also for dirmngr. * dirmngr/dirmngr.c (main): Terminate csh style output with a semicolon. --- dirmngr/dirmngr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dirmngr/dirmngr.c') diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c index 7d478b373..a72acd01c 100644 --- a/dirmngr/dirmngr.c +++ b/dirmngr/dirmngr.c @@ -1066,7 +1066,7 @@ main (int argc, char **argv) if (csh_style) { *strchr (infostr, '=') = ' '; - es_printf ( "setenv %s\n", infostr); + es_printf ( "setenv %s;\n", infostr); } else { -- cgit v1.2.3 From 61ccd8d92d9d3b8ba0eca3c2969d7f6f37e16405 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Tue, 3 Jan 2012 16:50:52 +0100 Subject: Fix last change: Only set gcrypt thread callback for older versions. * dirmngr/dirmngr.c, g13/g13.c: Rename FIX_GCRY_PTH_INIT to USE_GCRY_THREAD_CBS. --- dirmngr/dirmngr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dirmngr/dirmngr.c') diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c index a72acd01c..2256c591c 100644 --- a/dirmngr/dirmngr.c +++ b/dirmngr/dirmngr.c @@ -281,10 +281,10 @@ static void handle_connections (assuan_fd_t listen_fd); ASSUAN_SYSTEM_PTH_IMPL; #if GCRY_THREAD_OPTION_VERSION == 0 -#define FIX_GCRY_PTH_INIT 1 +#define USE_GCRY_THREAD_CBS 1 #endif -#ifdef FIX_GCRY_PTH_INIT +#ifdef USE_GCRY_THREAD_CBS GCRY_THREAD_OPTION_PTH_IMPL; static int fixed_gcry_pth_init (void) { -- cgit v1.2.3