summaryrefslogtreecommitdiffstats
path: root/g13
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>2012-01-02 22:15:00 +0100
committerMarcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>2012-01-02 22:15:00 +0100
commita2d9e48fcca6cfc2dfadef6dbd3579a30314676b (patch)
treef379d06676984a965c6daacbc6fed119dca14f4f /g13
parentUse the longest key ID available when talking to a HKP server. (diff)
downloadgnupg2-a2d9e48fcca6cfc2dfadef6dbd3579a30314676b.tar.xz
gnupg2-a2d9e48fcca6cfc2dfadef6dbd3579a30314676b.zip
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.
Diffstat (limited to 'g13')
-rw-r--r--g13/g13.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/g13/g13.c b/g13/g13.c
index 8e5532c47..e38f21165 100644
--- a/g13/g13.c
+++ b/g13/g13.c
@@ -204,11 +204,18 @@ static void join_idle_task (void);
/* Begin Pth wrapper functions. */
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
+
/* End Pth wrapper functions. */
@@ -361,6 +368,8 @@ 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;
@@ -370,6 +379,7 @@ main ( int argc, char **argv)
log_fatal ("can't register GNU Pth with Libgcrypt: %s\n",
gpg_strerror (err));
}
+#endif
/* Check that the Libgcrypt is suitable. */
if (!gcry_check_version (NEED_LIBGCRYPT_VERSION) )