From: Sebastian Harl Date: Sun, 28 Oct 2007 09:50:24 +0000 (+0100) Subject: perl plugin: Set $0 to "collectd". X-Git-Tag: collectd-4.2.1~12 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=bc6790409971d84b1c8aa7201667c869e155e03b;p=collectd.git 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 --- 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);