diff options
author | Werner Koch <[email protected]> | 2014-06-24 08:56:19 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2014-06-24 08:56:19 +0000 |
commit | aacb43a730a6f52c1ac91131afed73ae6ef25416 (patch) | |
tree | ff9b65fd3228e37cc4ce7fd6b367a9dd5cdf4aa4 | |
parent | Improve configure option --with-libgpg-error-prefix (diff) | |
download | gnupg-aacb43a730a6f52c1ac91131afed73ae6ef25416.tar.gz gnupg-aacb43a730a6f52c1ac91131afed73ae6ef25416.zip |
Remove thread callbacks for libgcrypt >= 1.6.
* agent/gpg-agent.c (GCRY_THREAD_OPTION_PTH_IMPL): Do not use with
libgcrypt >= 1.6.
(main): Ditto.
* scd/scdaemon.c (GCRY_THREAD_OPTION_PTH_IMPL): Ditto.
(main): Ditto.
--
This is not anymore needed but kept for compatibility with Libgcrypt <
1.6.
-rw-r--r-- | agent/gpg-agent.c | 6 | ||||
-rw-r--r-- | scd/scdaemon.c | 11 |
2 files changed, 14 insertions, 3 deletions
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index 1f53a3727..bf2a26d47 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -308,6 +308,7 @@ static int check_for_running_agent (int silent, int mode); /* Pth wrapper function definitions. */ ASSUAN_SYSTEM_PTH_IMPL; +#if GCRYPT_VERSION_NUMBER < 0x010600 GCRY_THREAD_OPTION_PTH_IMPL; #if GCRY_THREAD_OPTION_VERSION < 1 static int fixed_gcry_pth_init (void) @@ -315,6 +316,7 @@ static int fixed_gcry_pth_init (void) return pth_self ()? 0 : (pth_init () == FALSE) ? errno : 0; } #endif +#endif /*GCRYPT_VERSION_NUMBER < 0x10600*/ #ifndef PTH_HAVE_PTH_THREAD_ID static unsigned long pth_thread_id (void) @@ -625,7 +627,8 @@ main (int argc, char **argv ) init_common_subsystems (); - /* Libgcrypt requires us to register the threading model first. +#if GCRYPT_VERSION_NUMBER < 0x010600 + /* Libgcrypt < 1.6 requires us to register the threading model first. Note that this will also do the pth_init. */ #if GCRY_THREAD_OPTION_VERSION < 1 gcry_threads_pth.init = fixed_gcry_pth_init; @@ -636,6 +639,7 @@ main (int argc, char **argv ) log_fatal ("can't register GNU Pth with Libgcrypt: %s\n", gpg_strerror (err)); } +#endif /*GCRYPT_VERSION_NUMBER < 0x010600*/ /* Check that the libraries are suitable. Do it here because diff --git a/scd/scdaemon.c b/scd/scdaemon.c index 5f6452114..e133ddc07 100644 --- a/scd/scdaemon.c +++ b/scd/scdaemon.c @@ -212,6 +212,7 @@ static void handle_connections (int listen_fd); /* Pth wrapper function definitions. */ ASSUAN_SYSTEM_PTH_IMPL; +#if GCRYPT_VERSION_NUMBER < 0x010600 GCRY_THREAD_OPTION_PTH_IMPL; #if GCRY_THREAD_OPTION_VERSION < 1 static int fixed_gcry_pth_init (void) @@ -219,6 +220,7 @@ static int fixed_gcry_pth_init (void) return pth_self ()? 0 : (pth_init () == FALSE) ? errno : 0; } #endif +#endif /*GCRYPT_VERSION_NUMBER < 0x010600*/ static char * @@ -380,7 +382,6 @@ main (int argc, char **argv ) { ARGPARSE_ARGS pargs; int orig_argc; - gpg_error_t err; char **orig_argv; FILE *configfp = NULL; char *configname = NULL; @@ -415,17 +416,23 @@ main (int argc, char **argv ) init_common_subsystems (); - /* Libgcrypt requires us to register the threading model first. +#if GCRYPT_VERSION_NUMBER < 0x010600 + /* Libgcrypt < 1.6 requires us to register the threading model first. Note that this will also do the pth_init. */ + { + gpg_error_t err; #if GCRY_THREAD_OPTION_VERSION < 1 gcry_threads_pth.init = fixed_gcry_pth_init; #endif + err = gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pth); if (err) { log_fatal ("can't register GNU Pth with Libgcrypt: %s\n", gpg_strerror (err)); } + } +#endif /*GCRYPT_VERSION_NUMBER < 0x010600*/ /* Check that the libraries are suitable. Do it here because the option parsing may need services of the library */ |