From: Florian Forster Date: Sun, 23 Nov 2008 16:22:12 +0000 (+0100) Subject: src/filter_chain.c: Actually abort default targets when one signals `stop'. X-Git-Tag: collectd-4.6.0~149 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=bd77780e9c9dc792e55fa32ff03b8c059f1a2ca7;p=collectd.git src/filter_chain.c: Actually abort default targets when one signals `stop'. It should not behave as documented. --- diff --git a/src/filter_chain.c b/src/filter_chain.c index 98185421..feda6f01 100644 --- a/src/filter_chain.c +++ b/src/filter_chain.c @@ -637,6 +637,9 @@ int fc_process_chain (const data_set_t *ds, value_list_t *vl, /* {{{ */ if (rule != NULL) return (0); + DEBUG ("fc_process_chain (%s): Executing the default targets.", + chain->name); + for (target = chain->targets; target != NULL; target = target->next) { /* If we get here, all matches have matched the value. Execute the @@ -645,8 +648,26 @@ int fc_process_chain (const data_set_t *ds, value_list_t *vl, /* {{{ */ &target->user_data); if (status < 0) { - WARNING ("fc_process_chain: The default target failed."); + WARNING ("fc_process_chain (%s): The default target failed.", + chain->name); } + else if (status == FC_ACTION_CONTINUE) + continue; + else if (status == FC_ACTION_STOP) + break; + else + { + WARNING ("fc_process_chain (%s): Unknown return value " + "from target `%s': %i", + chain->name, target->name, status); + } + } + + if (target != NULL) + { + DEBUG ("fc_process_chain (%s): Default target `%s' signaled " + "the stop condition.", + chain->name, target->name); } return (0);