From: Florian Forster Date: Wed, 2 Dec 2015 09:43:42 +0000 (+0100) Subject: varnish plugin: Fix implicit cast from int to bool. X-Git-Tag: collectd-5.6.0~535^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=96c33de27441f6487ed252e22f7c1129d5bf05fc;p=collectd.git varnish plugin: Fix implicit cast from int to bool. Also revert the inclusion of as per our coding guidelines. The native C99 _Bool is used instead. --- diff --git a/src/varnish.c b/src/varnish.c index 36908ff1..65562d32 100644 --- a/src/varnish.c +++ b/src/varnish.c @@ -23,7 +23,6 @@ * Florian octo Forster **/ -#include #include "collectd.h" #include "common.h" #include "plugin.h" @@ -589,7 +588,7 @@ static int varnish_read (user_data_t *ud) /* {{{ */ { struct VSM_data *vd; const c_varnish_stats_t *stats; - bool test; + _Bool ok; user_config_t *conf; @@ -619,11 +618,11 @@ static int varnish_read (user_data_t *ud) /* {{{ */ } #if HAVE_VARNISH_V3 - test = VSC_Open (vd, /* diag = */ 1); + ok = (VSC_Open (vd, /* diag = */ 1) == 0); #else /* if HAVE_VARNISH_V4 */ - test = VSM_Open (vd); + ok = (VSM_Open (vd) == 0); #endif - if (test) + if (!ok) { VSM_Delete (vd); ERROR ("varnish plugin: Unable to open connection.");