projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6d6aa2b
)
aggregation plugin: Declare variables on initialization.
author
Florian Forster
<octo@collectd.org>
Tue, 28 Nov 2017 07:17:05 +0000
(08:17 +0100)
committer
Florian Forster
<octo@collectd.org>
Tue, 28 Nov 2017 07:17:05 +0000
(08:17 +0100)
src/aggregation.c
patch
|
blob
|
history
diff --git
a/src/aggregation.c
b/src/aggregation.c
index
4e20d0c
..
0c9c5ab
100644
(file)
--- a/
src/aggregation.c
+++ b/
src/aggregation.c
@@
-506,11
+506,7
@@
static int agg_config_handle_group_by(oconfig_item_t const *ci, /* {{{ */
static int agg_config_aggregation(oconfig_item_t *ci) /* {{{ */
{
static int agg_config_aggregation(oconfig_item_t *ci) /* {{{ */
{
- aggregation_t *agg;
- _Bool is_valid;
- int status;
-
- agg = calloc(1, sizeof(*agg));
+ aggregation_t *agg = calloc(1, sizeof(*agg));
if (agg == NULL) {
ERROR("aggregation plugin: calloc failed.");
return (-1);
if (agg == NULL) {
ERROR("aggregation plugin: calloc failed.");
return (-1);
@@
-579,7
+575,7
@@
static int agg_config_aggregation(oconfig_item_t *ci) /* {{{ */
agg->regex_fields |= LU_GROUP_BY_TYPE_INSTANCE;
/* Sanity checking */
agg->regex_fields |= LU_GROUP_BY_TYPE_INSTANCE;
/* Sanity checking */
- is_valid = 1;
+
_Bool
is_valid = 1;
if (strcmp("/.*/", agg->ident.type) == 0) /* {{{ */
{
ERROR("aggregation plugin: It appears you did not specify the required "
if (strcmp("/.*/", agg->ident.type) == 0) /* {{{ */
{
ERROR("aggregation plugin: It appears you did not specify the required "
@@
-639,7
+635,7
@@
static int agg_config_aggregation(oconfig_item_t *ci) /* {{{ */
return (-1);
} /* }}} */
return (-1);
} /* }}} */
- status = lookup_add(lookup, &agg->ident, agg->group_by, agg);
+
int
status = lookup_add(lookup, &agg->ident, agg->group_by, agg);
if (status != 0) {
ERROR("aggregation plugin: lookup_add failed with status %i.", status);
sfree(agg);
if (status != 0) {
ERROR("aggregation plugin: lookup_add failed with status %i.", status);
sfree(agg);