Code

perl plugin: Use the `BaseName' only if it is non-empty.
[collectd.git] / src / load.c
index b92e54f53b60380b77df26f7e1225a571f36c4d3..7be594d15f26bd8b9a7de2c08f9b93b12716eff1 100644 (file)
@@ -23,8 +23,6 @@
 #include "common.h"
 #include "plugin.h"
 
-#define MODULE_NAME "load"
-
 #if defined(HAVE_GETLOADAVG) || defined(KERNEL_LINUX) || defined(HAVE_LIBSTATGRAB)
 # define LOAD_HAVE_READ 1
 #else
@@ -151,12 +149,13 @@ static int load_read (void)
 }
 #endif /* LOAD_HAVE_READ */
 
-void module_register (void)
+void module_register (modreg_e load)
 {
-       plugin_register_data_set (&ds);
+       if (load & MR_DATASETS)
+               plugin_register_data_set (&ds);
+
 #if LOAD_HAVE_READ
-       plugin_register_read ("load", load_read);
+       if (load & MR_READ)
+               plugin_register_read ("load", load_read);
 #endif
-}
-
-#undef MODULE_NAME
+} /* void module_register */