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);
+ return -1;
}
sstrncpy(agg->ident.host, "/.*/", sizeof(agg->ident.host));
is_valid = 0;
} /* }}} */
- if (!is_valid) /* {{{ */
- {
+ if (!is_valid) { /* {{{ */
sfree(agg);
- 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);
c_complain_t complaint = C_COMPLAIN_INIT_STATIC;
- pthread_mutex_lock(&ping_lock);
-
- pingobj = ping_construct();
+ pingobj_t *pingobj = ping_construct();
if (pingobj == NULL) {
ERROR("ping plugin: ping_construct failed.");
+ pthread_mutex_lock(&ping_lock);
ping_thread_error = 1;
pthread_mutex_unlock(&ping_lock);
- return ((void *)-1);
+ return (void *)-1;
}
if (ping_source != NULL)
if (count == 0) {
ERROR("ping plugin: No host could be added to ping object. Giving up.");
+ pthread_mutex_lock(&ping_lock);
ping_thread_error = 1;
pthread_mutex_unlock(&ping_lock);
- return ((void *)-1);
+ return (void *)-1;
}
/* Set up `ts_int' */