From 3b9c7b21b4ddfcf59a0147bc9e91e8889ca78d56 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Mon, 18 Feb 2019 14:46:55 +0100 Subject: [PATCH] Handle failure of simple config callbacks When they return an error, collectd should not ignore this. Fixes #3076 --- src/daemon/configfile.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 " -- 2.11.0