From: Ruben Kerkhof Date: Mon, 18 Feb 2019 13:46:55 +0000 (+0100) Subject: Handle failure of simple config callbacks X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=3b9c7b2;p=collectd.git Handle failure of simple config callbacks When they return an error, collectd should not ignore this. Fixes #3076 --- diff --git a/src/daemon/configfile.c b/src/daemon/configfile.c index 8bf6b8d7..735be83d 100644 --- a/src/daemon/configfile.c +++ b/src/daemon/configfile.c @@ -411,10 +411,12 @@ static int dispatch_block_plugin(oconfig_item_t *ci) { } /* Hm, no complex plugin found. Dispatch the values one by one */ - for (int i = 0; i < ci->children_num; i++) { - if (ci->children[i].children == NULL) - dispatch_value_plugin(name, ci->children + i); - else { + for (int i = 0, ret = 0; i < ci->children_num; i++) { + if (ci->children[i].children == NULL) { + ret = dispatch_value_plugin(name, ci->children + i); + if (ret != 0) + return ret; + } else { WARNING("There is a `%s' block within the " "configuration for the %s plugin. " "The plugin either only expects "