Skip to content

Commit

Permalink
Merge pull request #793 from vincentbernat/fix/gcrypt-deprecated
Browse files Browse the repository at this point in the history
network: don't enable gcrypt thread callbacks when gcrypt recent enough
  • Loading branch information
pyr committed Nov 11, 2014
2 parents 3543c79 + 8cae289 commit e51e0f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libcollectdclient/network_buffer.c
Expand Up @@ -54,7 +54,9 @@
/* Re enable deprecation warnings */
# pragma GCC diagnostic warning "-Wdeprecated-declarations"
# endif
# if GCRYPT_VERSION_NUMBER < 0x010600
GCRY_THREAD_OPTION_PTHREAD_IMPL;
# endif
#endif

#include "collectd/network_buffer.h"
Expand Down Expand Up @@ -131,7 +133,9 @@ static _Bool have_gcrypt (void) /* {{{ */
need_init = 0;

#if HAVE_LIBGCRYPT
# if GCRYPT_VERSION_NUMBER < 0x010600
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
# endif

if (!gcry_check_version (GCRYPT_VERSION))
return (0);
Expand Down
4 changes: 4 additions & 0 deletions src/network.c
Expand Up @@ -77,7 +77,9 @@
/* Re enable deprecation warnings */
# pragma GCC diagnostic warning "-Wdeprecated-declarations"
# endif
# if GCRYPT_VERSION_NUMBER < 0x010600
GCRY_THREAD_OPTION_PTHREAD_IMPL;
# endif
#endif

#ifndef IPV6_ADD_MEMBERSHIP
Expand Down Expand Up @@ -511,7 +513,9 @@ static void network_init_gcrypt (void) /* {{{ */
* above doesn't count, as it doesn't implicitly initalize Libgcrypt.
*
* tl;dr: keep all these gry_* statements in this exact order please. */
# if GCRYPT_VERSION_NUMBER < 0x010600
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
# endif
gcry_check_version (NULL);
gcry_control (GCRYCTL_INIT_SECMEM, 32768);
gcry_control (GCRYCTL_INITIALIZATION_FINISHED);
Expand Down

0 comments on commit e51e0f2

Please sign in to comment.