X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Flibcollectdclient%2Fnetwork_buffer.c;h=8d35d2031bf07f2608494056fccb24bc34a811e1;hb=49ac868d2346c77335272b8a643bca295db9feaa;hp=61c7c22e2d7ab963a2d98977f8c0c3747ad18723;hpb=2421812ea47269c50920414a6e3c32448800120f;p=collectd.git diff --git a/src/libcollectdclient/network_buffer.c b/src/libcollectdclient/network_buffer.c index 61c7c22e..8d35d203 100644 --- a/src/libcollectdclient/network_buffer.c +++ b/src/libcollectdclient/network_buffer.c @@ -1,6 +1,6 @@ /** * collectd - src/libcollectdclient/network_buffer.c - * Copyright (C) 2010-2012 Florian octo Forster + * Copyright (C) 2010-2015 Florian octo Forster * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -134,13 +134,16 @@ static _Bool have_gcrypt (void) /* {{{ */ #if HAVE_LIBGCRYPT # if GCRYPT_VERSION_NUMBER < 0x010600 - gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); + if (gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread)) + return (0); # endif if (!gcry_check_version (GCRYPT_VERSION)) return (0); - gcry_control (GCRYCTL_INIT_SECMEM, 32768, 0); + if (!gcry_control (GCRYCTL_INIT_SECMEM, 32768, 0)) + return (0); + gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); result = 1; @@ -792,9 +795,9 @@ int lcc_network_buffer_finalize (lcc_network_buffer_t *nb) /* {{{ */ #if HAVE_LIBGCRYPT if (nb->seclevel == SIGN) - nb_add_signature (nb); + return nb_add_signature (nb); else if (nb->seclevel == ENCRYPT) - nb_add_encryption (nb); + return nb_add_encryption (nb); #endif return (0);