X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fnetwork.c;h=2296927dff1041b82056ea0132bcd94e8c994d88;hb=21ab7512825cf8177d5eee5101344b45d0854610;hp=d3c6044231edf2df1bf16e9df8f1c7f05509323d;hpb=8391a4430d5dffea44898adb628a5bcdbcfe31ba;p=collectd.git diff --git a/src/network.c b/src/network.c index d3c60442..2296927d 100644 --- a/src/network.c +++ b/src/network.c @@ -30,7 +30,6 @@ #include "common.h" #include "configfile.h" #include "utils_fbhash.h" -#include "utils_avltree.h" #include "utils_cache.h" #include "utils_complain.h" @@ -494,6 +493,8 @@ static int network_dispatch_notification (notification_t *n) /* {{{ */ #if HAVE_LIBGCRYPT static void network_init_gcrypt (void) /* {{{ */ { + gcry_error_t err; + /* http://lists.gnupg.org/pipermail/gcrypt-devel/2003-August/000458.html * Because you can't know in a library whether another library has * already initialized the library */ @@ -508,10 +509,23 @@ static void network_init_gcrypt (void) /* {{{ */ * * 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); + err = gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); + if (err) + { + ERROR ("network plugin: gcry_control (GCRYCTL_SET_THREAD_CBS) failed: %s", gcry_strerror (err)); + abort (); + } # endif + gcry_check_version (NULL); - gcry_control (GCRYCTL_INIT_SECMEM, 32768); + + err = gcry_control (GCRYCTL_INIT_SECMEM, 32768); + if (err) + { + ERROR ("network plugin: gcry_control (GCRYCTL_SET_THREAD_CBS) failed: %s", gcry_strerror (err)); + abort (); + } + gcry_control (GCRYCTL_INITIALIZATION_FINISHED); } /* }}} void network_init_gcrypt */