X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fnetwork.c;h=a2221e5b4661f8f5410cf2e701896ecbbd0b24a3;hb=ecbcaadde7dff838f09dfb04c7eb90f126e35abf;hp=ce9b0cc71fe32f871a63e1f4f75e7039314238f2;hpb=21077b074c468a41dbd60baad691ebc7f2991d43;p=collectd.git diff --git a/src/network.c b/src/network.c index ce9b0cc7..a2221e5b 100644 --- a/src/network.c +++ b/src/network.c @@ -76,7 +76,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 @@ -508,7 +510,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); @@ -1996,7 +2000,7 @@ static sockent_t *sockent_create (int type) /* {{{ */ { sockent_t *se; - if ((type != SOCKENT_TYPE_CLIENT) || (type != SOCKENT_TYPE_SERVER)) + if ((type != SOCKENT_TYPE_CLIENT) && (type != SOCKENT_TYPE_SERVER)) return (NULL); se = malloc (sizeof (*se));