Various plugins: Use the IS_TRUE and IS_FALSE macros everywhere.
[collectd.git] / src / vmem.c
index 5341e15..d32f1db 100644 (file)
@@ -45,15 +45,15 @@ static void submit (const char *plugin_instance, const char *type,
   vl.values = values;
   vl.values_len = values_len;
 
-  vl.time = time (NULL);
   sstrncpy (vl.host, hostname_g, sizeof (vl.host));
   sstrncpy (vl.plugin, "vmem", sizeof (vl.plugin));
   if (plugin_instance != NULL)
     sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
+  sstrncpy (vl.type, type, sizeof (vl.type));
   if (type_instance != NULL)
     sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
 
-  plugin_dispatch_values (type, &vl);
+  plugin_dispatch_values (&vl);
 } /* void vmem_submit */
 
 static void submit_two (const char *plugin_instance, const char *type,
@@ -77,9 +77,7 @@ static int vmem_config (const char *key, const char *value)
 {
   if (strcasecmp ("Verbose", key) == 0)
   {
-    if ((strcasecmp ("true", value) == 0)
-       || (strcasecmp ("yes", value) == 0)
-       || (strcasecmp ("on", value) == 0))
+    if (IS_TRUE (value))
       verbose_output = 1;
     else
       verbose_output = 0;