From bc6790409971d84b1c8aa7201667c869e155e03b Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sun, 28 Oct 2007 10:50:24 +0100 Subject: [PATCH] perl plugin: Set $0 to "collectd". perl_parse() has to set it to "-e" which is not very meaningful. It would be even nicer to set it to argv[0] but this is not available from inside the plugin. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- src/perl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/perl.c b/src/perl.c index dde34b80..1ed9d003 100644 --- a/src/perl.c +++ b/src/perl.c @@ -831,6 +831,10 @@ static int init_pi (int argc, char **argv) log_err ("module_register: Unable to bootstrap Collectd."); exit (1); } + + /* Set $0 to "collectd" because perl_parse() has to set it to "-e". */ + Perl_sv_setpv (perl, Perl_get_sv (perl, "0", 0), "collectd"); + perl_run (perl); plugin_register_log ("perl", perl_log); -- 2.30.2