projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1856 from rubenk/snmp-dont-dispatch-values-with-empty-type-instance
[collectd.git]
/
src
/
match_regex.c
diff --git
a/src/match_regex.c
b/src/match_regex.c
index
6e6bda2
..
cd63016
100644
(file)
--- a/
src/match_regex.c
+++ b/
src/match_regex.c
@@
-32,6
+32,7
@@
*/
#include "collectd.h"
*/
#include "collectd.h"
+
#include "filter_chain.h"
#include <sys/types.h>
#include "filter_chain.h"
#include <sys/types.h>
@@
-99,12
+100,10
@@
static void mr_free_match (mr_match_t *m) /* {{{ */
static int mr_match_regexen (mr_regex_t *re_head, /* {{{ */
const char *string)
{
static int mr_match_regexen (mr_regex_t *re_head, /* {{{ */
const char *string)
{
- mr_regex_t *re;
-
if (re_head == NULL)
return (FC_MATCH_MATCHES);
if (re_head == NULL)
return (FC_MATCH_MATCHES);
- for (re = re_head; re != NULL; re = re->next)
+ for (
mr_regex_t *
re = re_head; re != NULL; re = re->next)
{
int status;
{
int status;
@@
-162,7
+161,7
@@
static int mr_config_add_regex (mr_regex_t **re_head, /* {{{ */
char errmsg[1024];
regerror (status, &re->re, errmsg, sizeof (errmsg));
errmsg[sizeof (errmsg) - 1] = 0;
char errmsg[1024];
regerror (status, &re->re, errmsg, sizeof (errmsg));
errmsg[sizeof (errmsg) - 1] = 0;
- log_err ("Compiling regex `%s' for `%s' failed: %s.",
+ log_err ("Compiling regex `%s' for `%s' failed: %s.",
re->re_str, ci->key, errmsg);
free (re->re_str);
free (re);
re->re_str, ci->key, errmsg);
free (re->re_str);
free (re);
@@
-191,7
+190,6
@@
static int mr_create (const oconfig_item_t *ci, void **user_data) /* {{{ */
{
mr_match_t *m;
int status;
{
mr_match_t *m;
int status;
- int i;
m = calloc (1, sizeof (*m));
if (m == NULL)
m = calloc (1, sizeof (*m));
if (m == NULL)
@@
-203,7
+201,7
@@
static int mr_create (const oconfig_item_t *ci, void **user_data) /* {{{ */
m->invert = 0;
status = 0;
m->invert = 0;
status = 0;
- for (i = 0; i < ci->children_num; i++)
+ for (i
nt i
= 0; i < ci->children_num; i++)
{
oconfig_item_t *child = ci->children + i;
{
oconfig_item_t *child = ci->children + i;
@@
-303,9
+301,8
@@
static int mr_match (const data_set_t __attribute__((unused)) *ds, /* {{{ */
void module_register (void)
{
void module_register (void)
{
- match_proc_t mproc;
+ match_proc_t mproc
= { 0 }
;
- memset (&mproc, 0, sizeof (mproc));
mproc.create = mr_create;
mproc.destroy = mr_destroy;
mproc.match = mr_match;
mproc.create = mr_create;
mproc.destroy = mr_destroy;
mproc.match = mr_match;