Skip to content

Commit

Permalink
Handle failure of simple config callbacks
Browse files Browse the repository at this point in the history
When they return an error, collectd should not ignore this.
Fixes #3076
  • Loading branch information
rubenk committed Feb 18, 2019
1 parent f0a2bef commit 3b9c7b2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/daemon/configfile.c
Expand Up @@ -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 "
Expand Down

0 comments on commit 3b9c7b2

Please sign in to comment.