X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ftarget_set.c;h=4f00cbbdaf1aedbc2bf6eedbdf60a003e826e9b5;hb=de6dd1339b0191713d13484dab95f031374fcc27;hp=6115639b5bcd73679b41f4a5623b0f38b43cbd69;hpb=ab11d1b4db61f750f51be6e41dbe8320d3c65404;p=collectd.git diff --git a/src/target_set.c b/src/target_set.c index 6115639b..4f00cbbd 100644 --- a/src/target_set.c +++ b/src/target_set.c @@ -25,6 +25,7 @@ **/ #include "collectd.h" + #include "common.h" #include "filter_chain.h" @@ -142,7 +143,6 @@ static int ts_create (const oconfig_item_t *ci, void **user_data) /* {{{ */ { ts_data_t *data; int status; - int i; data = calloc (1, sizeof (*data)); if (data == NULL) @@ -159,7 +159,7 @@ static int ts_create (const oconfig_item_t *ci, void **user_data) /* {{{ */ data->meta = NULL; status = 0; - for (i = 0; i < ci->children_num; i++) + for (int i = 0; i < ci->children_num; i++) { oconfig_item_t *child = ci->children + i; @@ -181,7 +181,7 @@ static int ts_create (const oconfig_item_t *ci, void **user_data) /* {{{ */ else if (strcasecmp ("TypeInstance", child->key) == 0) status = ts_config_add_string (&data->type_instance, child, /* may be empty = */ 1); - else if (strcasecmp ("MetaDataSet", child->key) == 0) + else if (strcasecmp ("MetaData", child->key) == 0) status = ts_config_add_meta (&data->meta, child, /* may be empty = */ 1); else @@ -206,8 +206,7 @@ static int ts_create (const oconfig_item_t *ci, void **user_data) /* {{{ */ && (data->meta == NULL)) { ERROR ("Target `set': You need to set at least one of `Host', " - "`Plugin', `PluginInstance', `TypeInstance', " - "`MetaDataSet' or `MetaDataEval'."); + "`Plugin', `PluginInstance', `TypeInstance', `MetaData'."); status = -1; } @@ -256,9 +255,8 @@ static int ts_invoke (const data_set_t *ds, value_list_t *vl, /* {{{ */ void module_register (void) { - target_proc_t tproc; + target_proc_t tproc = { 0 }; - memset (&tproc, 0, sizeof (tproc)); tproc.create = ts_create; tproc.destroy = ts_destroy; tproc.invoke = ts_invoke;