From: Sebastian Harl Date: Sun, 22 Apr 2007 13:47:38 +0000 (+0200) Subject: perl plugin: Respect the modreg flags in module_register (). X-Git-Tag: collectd-4.0.0~66 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=6106b146e0ee9b02cd34501eec58a4340be89029;p=collectd.git perl plugin: Respect the modreg flags in module_register (). TODO: Pass on MR_DATASETS to perl plugins. Signed-off-by: Sebastian Harl --- 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;