X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fperl.c;h=b5965d67c2386cc826502591cb202fe8e44ddd5b;hb=56159e13f4b983a2e8c846b39ca96b2384ec746a;hp=bb62267e89608166c70392ce52518fbd0ce74a51;hpb=b48454eddeaa6d8e0edb9547190cfc509d8abeb4;p=collectd.git diff --git a/src/perl.c b/src/perl.c index bb62267e..b5965d67 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 @@ -640,9 +640,6 @@ static int pplugin_dispatch_values (pTHX_ HV *values) if (NULL != (tmp = hv_fetch (values, "time", 4, 0))) { list.time = (time_t)SvIV (*tmp); } - else { - list.time = time (NULL); - } if (NULL != (tmp = hv_fetch (values, "host", 4, 0))) { sstrncpy (list.host, SvPV_nolen (*tmp), sizeof (list.host)); @@ -1092,7 +1089,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) */ @@ -1790,7 +1787,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; @@ -1806,7 +1803,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) {