From 6106b146e0ee9b02cd34501eec58a4340be89029 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sun, 22 Apr 2007 15:47:38 +0200 Subject: [PATCH] perl plugin: Respect the modreg flags in module_register (). TODO: Pass on MR_DATASETS to perl plugins. Signed-off-by: Sebastian Harl --- src/perl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/perl.c b/src/perl.c index d8f294f0..f42708d7 100644 --- a/src/perl.c +++ b/src/perl.c @@ -1064,7 +1064,7 @@ static void xs_init (pTHX) /* * Create the perl interpreter and register it with collectd. */ -void module_register (void) +void module_register (modreg_e load) { char *embed_argv[] = { "", "-e", "bootstrap Collectd \""VERSION"\"", NULL }; int embed_argc = 3; @@ -1097,7 +1097,10 @@ void module_register (void) plugin_register_log ("perl", perl_log); plugin_register_config ("perl", perl_config, config_keys, config_keys_num); plugin_register_init ("perl", perl_init); - plugin_register_read ("perl", perl_read); + + if (load & MR_READ) + plugin_register_read ("perl", perl_read); + plugin_register_write ("perl", perl_write); plugin_register_shutdown ("perl", perl_shutdown); return; -- 2.30.2