X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fdaemon%2Ffilter_chain.c;h=ecc7f165a5a1f73064aedcdaa9b41e086f24abf1;hp=5042913210557cedd1fbdc638bd26afa98e16fe6;hb=f9a6df05238501ca41931af0d8d51acea716c105;hpb=791e99923dbbf045b11fbd7b0ea8df647e29593e diff --git a/src/daemon/filter_chain.c b/src/daemon/filter_chain.c index 50429132..ecc7f165 100644 --- a/src/daemon/filter_chain.c +++ b/src/daemon/filter_chain.c @@ -904,17 +904,17 @@ int fc_process_chain (const data_set_t *ds, value_list_t *vl, /* {{{ */ { fc_rule_t *rule; fc_target_t *target; - int status; + int status = FC_TARGET_CONTINUE; if (chain == NULL) return (-1); DEBUG ("fc_process_chain (chain = %s);", chain->name); - status = FC_TARGET_CONTINUE; for (rule = chain->rules; rule != NULL; rule = rule->next) { fc_match_t *match; + status = FC_TARGET_CONTINUE; if (rule->name[0] != 0) { @@ -976,8 +976,7 @@ int fc_process_chain (const data_set_t *ds, value_list_t *vl, /* {{{ */ } } - if ((status == FC_TARGET_STOP) - || (status == FC_TARGET_RETURN)) + if ((status == FC_TARGET_STOP) || (status == FC_TARGET_RETURN)) { if (rule->name[0] != 0) { @@ -988,20 +987,10 @@ int fc_process_chain (const data_set_t *ds, value_list_t *vl, /* {{{ */ } break; } - else - { - status = FC_TARGET_CONTINUE; - } } /* for (rule) */ - if (status == FC_TARGET_STOP) - return (FC_TARGET_STOP); - else if (status == FC_TARGET_RETURN) - return (FC_TARGET_CONTINUE); - - /* for-loop has been aborted: A target returned `FC_TARGET_STOP' */ - if (rule != NULL) - return (FC_TARGET_CONTINUE); + if ((status == FC_TARGET_STOP) || (status == FC_TARGET_RETURN)) + return (status); DEBUG ("fc_process_chain (%s): Executing the default targets.", chain->name);