From cad67e6fcbaf2cad7703ef4f83a92dbd87d44cde Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sat, 17 Nov 2007 18:41:08 +0100 Subject: [PATCH] perl plugin: Removed logging calls from call_by_name(). The function might be called from a logging callback resulting in an infinite loop. Instead the error message is now saved in $@. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- src/perl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/perl.c b/src/perl.c index 4ae3cd1a..05e4b522 100644 --- a/src/perl.c +++ b/src/perl.c @@ -751,7 +751,7 @@ static XS (Collectd_call_by_name) char *name = NULL; if (NULL == (tmp = get_sv ("Collectd::cb_name", 0))) { - log_debug ("Collectd::call_by_name: cb_name is not set."); + sv_setpv (get_sv ("@", 1), "cb_name has not been set"); CLEAR_STACK_FRAME; return; } @@ -759,7 +759,7 @@ static XS (Collectd_call_by_name) name = SvPV_nolen (tmp); if (NULL == get_cv (name, 0)) { - log_err ("Collectd::call_by_name: Unknown callback \"%s\".", name); + sv_setpvf (get_sv ("@", 1), "unknown callback \"%s\"", name); CLEAR_STACK_FRAME; return; } -- 2.30.2