X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ffilter_chain.c;h=903f66f912d60087dd56b35458bb3b7bc58c3114;hb=865a6c83250e3d4381596a0d937df31d563f97c6;hp=e25e7a03316dfd07dfb282b3fcd06c205014bcef;hpb=cc00aef9aff0f52961c297b24cdea2c3b69782d9;p=collectd.git diff --git a/src/filter_chain.c b/src/filter_chain.c index e25e7a03..903f66f9 100644 --- a/src/filter_chain.c +++ b/src/filter_chain.c @@ -882,17 +882,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) { @@ -954,8 +954,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) { @@ -966,16 +965,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); + if ((status == FC_TARGET_STOP) || (status == FC_TARGET_RETURN)) + return (status); DEBUG ("fc_process_chain (%s): Executing the default targets.", chain->name);