From 96c33de27441f6487ed252e22f7c1129d5bf05fc Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 2 Dec 2015 10:43:42 +0100 Subject: [PATCH] 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. --- src/varnish.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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."); -- 2.11.0