varnish plugin: Avoid unused variable even harder.
[collectd.git] / src / varnish.c
index 69daa98..d105b02 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,21 +159,16 @@ static int varnish_monitor(void *priv,
   strcpy(namebuff, c + 1);
   name = namebuff;
 
-  (void)class;
-
 #elif HAVE_VARNISH_V4
-  class = pt->section->fantom->type;
-  name = pt->desc->name;
-
-  if (strcmp(class, "MAIN") != 0)
+  if (strcmp(pt->section->fantom->type, "MAIN") != 0)
     return 0;
 
+  name = pt->desc->name;
 #elif HAVE_VARNISH_V3
-  class = pt->class;
-  name = pt->name;
-
-  if (strcmp(class, "") != 0)
+  if (strcmp(pt->class, "") != 0)
     return 0;
+
+  name = pt->name;
 #endif
 
   val = *(const volatile uint64_t *)pt->ptr;