X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fmatch_regex.c;h=1fca88986331e1c4d30257e7e0e7d73dfb9dc7a2;hb=e728e2bb0c969ff1a69b19bb0addf1adc9bc6f87;hp=e0ab7bd70917295300abd59bb87204a7945ab369;hpb=acdee2de9cd33d85bc7b37d009ba341772d80678;p=collectd.git diff --git a/src/match_regex.c b/src/match_regex.c index e0ab7bd7..1fca8898 100644 --- a/src/match_regex.c +++ b/src/match_regex.c @@ -1,6 +1,7 @@ /** * collectd - src/match_regex.c * Copyright (C) 2008 Sebastian Harl + * Copyright (C) 2008 Florian Forster * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -105,10 +106,20 @@ static int mr_match_regexen (mr_regex_t *re_head, /* {{{ */ /* nmatch = */ 0, /* pmatch = */ NULL, /* eflags = */ 0); if (status == 0) - return (FC_MATCH_MATCHES); + { + DEBUG ("regex match: Regular expression `%s' matches `%s'.", + re->re_str, string); + } + else + { + DEBUG ("regex match: Regular expression `%s' does not match `%s'.", + re->re_str, string); + return (FC_MATCH_NO_MATCH); + } + } - return (FC_MATCH_NO_MATCH); + return (FC_MATCH_MATCHES); } /* }}} int mr_match_regexen */ static int mr_config_add_regex (mr_regex_t **re_head, /* {{{ */ @@ -246,8 +257,10 @@ static int mr_destroy (void **user_data) /* {{{ */ return (0); } /* }}} int mr_destroy */ -static int mr_match (const data_set_t *ds, const value_list_t *vl, /* {{{ */ - notification_meta_t **meta, void **user_data) +static int mr_match (const data_set_t __attribute__((unused)) *ds, /* {{{ */ + const value_list_t *vl, + notification_meta_t __attribute__((unused)) **meta, + void **user_data) { mr_match_t *m;