collectd-nagios(1) and collectd-unixsock(5): Reference one another.
[collectd.git] / src / perl.c
index c997749..3be3762 100644 (file)
@@ -26,7 +26,6 @@
 
 #include "collectd.h"
 #include "common.h"
-#include "plugin.h"
 
 #include "configfile.h"
 
 
 #include <XSUB.h>
 
+/* Some versions of Perl define their own version of DEBUG... :-/ */
+#ifdef DEBUG
+# undef DEBUG
+#endif /* DEBUG */
+
+/* ... while we want the definition found in plugin.h. */
+#include "plugin.h"
+
 #define PLUGIN_INIT     0
 #define PLUGIN_READ     1
 #define PLUGIN_WRITE    2
@@ -1069,7 +1076,7 @@ static void xs_init (pTHX)
 /*
  * Create the perl interpreter and register it with collectd.
  */
-void module_register (modreg_e load)
+void module_register (void)
 {
        char *embed_argv[] = { "", "-e", "bootstrap Collectd \""VERSION"\"", NULL };
        int  embed_argc    = 3;
@@ -1103,8 +1110,7 @@ void module_register (modreg_e load)
        plugin_register_config ("perl", perl_config, config_keys, config_keys_num);
        plugin_register_init ("perl", perl_init);
 
-       if (load & MR_READ)
-               plugin_register_read ("perl", perl_read);
+       plugin_register_read ("perl", perl_read);
 
        plugin_register_write ("perl", perl_write);
        plugin_register_shutdown ("perl", perl_shutdown);