varnish plugin: avoid unused variable in V5 block
[collectd.git] / src / varnish.c
index 67c5bfd..ebc8e7a 100644 (file)
@@ -144,7 +144,6 @@ static int varnish_monitor(void *priv,
 {
   uint64_t val;
   const user_config_t *conf;
-  const char *class;
   const char *name;
 
   if (pt == NULL)
@@ -160,9 +159,9 @@ static int varnish_monitor(void *priv,
   strcpy(namebuff, c + 1);
   name = namebuff;
 
-  (void)class;
-
 #elif HAVE_VARNISH_V4
+  const char *class;
+
   class = pt->section->fantom->type;
   name = pt->desc->name;
 
@@ -170,6 +169,8 @@ static int varnish_monitor(void *priv,
     return 0;
 
 #elif HAVE_VARNISH_V3
+  const char *class;
+
   class = pt->class;
   name = pt->name;
 
@@ -1390,7 +1391,7 @@ static int varnish_read(user_data_t *ud) /* {{{ */
 #endif
 #if HAVE_VARNISH_V3 || HAVE_VARNISH_V4
   if (!ok) {
-    VSM_Destroy(&vd);
+    VSM_Delete(vd);
     ERROR("varnish plugin: Unable to open connection.");
     return -1;
   }
@@ -1403,7 +1404,7 @@ static int varnish_read(user_data_t *ud) /* {{{ */
 #endif
 #if HAVE_VARNISH_V3 || HAVE_VARNISH_V4
   if (!stats) {
-    VSM_Destroy(&vd);
+    VSM_Delete(vd);
     ERROR("varnish plugin: Unable to get statistics.");
     return -1;
   }