summaryrefslogtreecommitdiffstats
path: root/scd/scdaemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'scd/scdaemon.c')
-rw-r--r--scd/scdaemon.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/scd/scdaemon.c b/scd/scdaemon.c
index c8905d4f0..128ecc31d 100644
--- a/scd/scdaemon.c
+++ b/scd/scdaemon.c
@@ -208,12 +208,18 @@ static void handle_connections (int listen_fd);
/* Pth wrapper function definitions. */
ASSUAN_SYSTEM_PTH_IMPL;
+#if defined(GCRY_THREAD_OPTION_VERSION) && (GCRY_THREAD_OPTION_VERSION == 0)
+#define USE_GCRY_THREAD_CBS 1
+#endif
+
+#ifdef USE_GCRY_THREAD_CBS
GCRY_THREAD_OPTION_PTH_IMPL;
+
static int fixed_gcry_pth_init (void)
{
return pth_self ()? 0 : (pth_init () == FALSE) ? errno : 0;
}
-
+#endif
static char *
@@ -413,6 +419,7 @@ main (int argc, char **argv )
/* Libgcrypt requires us to register the threading model first.
Note that this will also do the pth_init. */
+#ifdef USE_GCRY_THREAD_CBS
gcry_threads_pth.init = fixed_gcry_pth_init;
err = gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pth);
if (err)
@@ -420,6 +427,7 @@ main (int argc, char **argv )
log_fatal ("can't register GNU Pth with Libgcrypt: %s\n",
gpg_strerror (err));
}
+#endif
/* Check that the libraries are suitable. Do it here because
the option parsing may need services of the library */