varnish plugin: Avoid unused variable even harder.
authorFlorian Forster <octo@collectd.org>
Thu, 9 Nov 2017 15:12:10 +0000 (16:12 +0100)
committerFlorian Forster <octo@collectd.org>
Thu, 9 Nov 2017 15:12:10 +0000 (16:12 +0100)
;-)

src/varnish.c

index ebc8e7a..d105b02 100644 (file)
@@ -160,22 +160,15 @@ static int varnish_monitor(void *priv,
   name = namebuff;
 
 #elif HAVE_VARNISH_V4
   name = namebuff;
 
 #elif HAVE_VARNISH_V4
-  const char *class;
-
-  class = pt->section->fantom->type;
-  name = pt->desc->name;
-
-  if (strcmp(class, "MAIN") != 0)
+  if (strcmp(pt->section->fantom->type, "MAIN") != 0)
     return 0;
 
     return 0;
 
+  name = pt->desc->name;
 #elif HAVE_VARNISH_V3
 #elif HAVE_VARNISH_V3
-  const char *class;
+  if (strcmp(pt->class, "") != 0)
+    return 0;
 
 
-  class = pt->class;
   name = pt->name;
   name = pt->name;
-
-  if (strcmp(class, "") != 0)
-    return 0;
 #endif
 
   val = *(const volatile uint64_t *)pt->ptr;
 #endif
 
   val = *(const volatile uint64_t *)pt->ptr;