X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fperl.c;h=4a76c0aa6f636d9075057c83e39b8d6b6b5c060d;hb=ef7fec0c4e0bbbabb356e6a570ac6297ee06eb80;hp=6d95082457b2654e65a8a3b7c5e46103310ee8e2;hpb=843d92b034b7303d818e222506bc165fb4f1fd22;p=collectd.git diff --git a/src/perl.c b/src/perl.c index 6d950824..4a76c0aa 100644 --- a/src/perl.c +++ b/src/perl.c @@ -36,7 +36,7 @@ #include #include -#if __GNUC__ +#if defined(COLLECT_DEBUG) && COLLECT_DEBUG && defined(__GNUC__) && __GNUC__ # pragma GCC poison sprintf #endif @@ -1092,7 +1092,7 @@ static XS (Collectd_plugin_log) XSRETURN_EMPTY; } - plugin_log (SvIV (ST (0)), SvPV_nolen (ST (1))); + plugin_log (SvIV (ST (0)), "%s", SvPV_nolen (ST (1))); XSRETURN_YES; } /* static XS (Collectd_plugin_log) */ @@ -1561,7 +1561,9 @@ static int init_pi (int argc, char **argv) PL_exit_flags |= PERL_EXIT_DESTRUCT_END; if (0 != perl_parse (aTHX_ xs_init, argc, argv, NULL)) { - log_err ("init_pi: Unable to bootstrap Collectd."); + SV *err = get_sv ("@", 1); + log_err ("init_pi: Unable to bootstrap Collectd: %s", + SvPV_nolen (err)); perl_destruct (perl_threads->head->interp); perl_free (perl_threads->head->interp); @@ -1788,7 +1790,7 @@ static int perl_config (oconfig_item_t *ci) for (i = 0; i < ci->children_num; ++i) { oconfig_item_t *c = ci->children + i; - int current_status; + int current_status = 0; if (NULL != perl_threads) aTHX = PERL_GET_CONTEXT; @@ -1804,7 +1806,10 @@ static int perl_config (oconfig_item_t *ci) else if (0 == strcasecmp (c->key, "Plugin")) current_status = perl_config_plugin (aTHX_ c); else + { log_warn ("Ignoring unknown config key \"%s\".", c->key); + current_status = 0; + } /* fatal error - it's up to perl_config_* to clean up */ if (0 > current_status) {