int normalize_tmp = atoi(value);
if (normalize_tmp < 0 || normalize_tmp > 2) {
ERROR("barometer: collectd_barometer_config: invalid normalization: %d",
- normalize_tmp);
+ normalize_tmp);
return 1;
}
config_normalize = normalize_tmp;
/* default to the global interval set before loading this plugin */
plugin_ctx_t ctx = {
- .interval = cf_get_default_interval(), .name = strdup(name),
+ .interval = cf_get_default_interval(),
+ .name = strdup(name),
};
if (ctx.name == NULL)
return ENOMEM;
/* Hm, no complex plugin found. Dispatch the values one by one */
for (int i = 0, ret = 0; i < ci->children_num; i++) {
if (ci->children[i].children == NULL) {
- oconfig_item_t *child = ci -> children + i;
+ oconfig_item_t *child = ci->children + i;
ret = dispatch_value_plugin(name, child);
if (ret != 0) {
- ERROR("Plugin %s failed to handle option %s, return code: %i", name, child -> key, ret);
+ ERROR("Plugin %s failed to handle option %s, return code: %i", name,
+ child->key, ret);
return ret;
}
} else {
return 0;
}
- temp = realloc(dst->children,
- sizeof(oconfig_item_t) *
- (dst->children_num + src->children_num - 1));
+ temp =
+ realloc(dst->children, sizeof(oconfig_item_t) *
+ (dst->children_num + src->children_num - 1));
if (temp == NULL) {
ERROR("configfile: realloc failed.");
return -1;
if ((src == NULL) || (src->children_num == 0))
return 0;
- temp =
- realloc(dst->children,
- sizeof(oconfig_item_t) * (dst->children_num + src->children_num));
+ temp = realloc(dst->children, sizeof(oconfig_item_t) *
+ (dst->children_num + src->children_num));
if (temp == NULL) {
ERROR("configfile: realloc failed.");
return -1;
return root;
} /* oconfig_item_t *cf_read_generic */
-/* #endif HAVE_WORDEXP_H */
+ /* #endif HAVE_WORDEXP_H */
#else /* if !HAVE_WORDEXP_H */
static oconfig_item_t *cf_read_generic(const char *path, const char *pattern,
value_list_t vl = VALUE_LIST_INIT;
value_t values[] = {
- {.gauge = snum}, {.gauge = mnum}, {.gauge = lnum},
+ {.gauge = snum},
+ {.gauge = mnum},
+ {.gauge = lnum},
};
vl.values = values;
else {
WARNING("load: getloadavg failed: %s", STRERRNO);
}
-/* #endif HAVE_GETLOADAVG */
+ /* #endif HAVE_GETLOADAVG */
#elif defined(KERNEL_LINUX)
gauge_t snum, mnum, lnum;
lnum = atof(fields[2]);
load_submit(snum, mnum, lnum);
-/* #endif KERNEL_LINUX */
+ /* #endif KERNEL_LINUX */
#elif HAVE_LIBSTATGRAB
gauge_t snum, mnum, lnum;
mnum = ls->min5;
lnum = ls->min15;
load_submit(snum, mnum, lnum);
-/* #endif HAVE_LIBSTATGRAB */
+ /* #endif HAVE_LIBSTATGRAB */
#elif HAVE_PERFSTAT
gauge_t snum, mnum, lnum;
mnum = (float)cputotal.loadavg[1] / (float)(1 << SBITS);
lnum = (float)cputotal.loadavg[2] / (float)(1 << SBITS);
load_submit(snum, mnum, lnum);
-/* #endif HAVE_PERFSTAT */
+ /* #endif HAVE_PERFSTAT */
#else
#error "No applicable input method."
derive_t tx) {
value_list_t vl = VALUE_LIST_INIT;
value_t values[] = {
- {.derive = rx}, {.derive = tx},
+ {.derive = rx},
+ {.derive = tx},
};
/* NOTE ON THE NEW NAMING SCHEMA:
derive_t uncompressed, derive_t compressed) {
value_list_t vl = VALUE_LIST_INIT;
value_t values[] = {
- {.derive = uncompressed}, {.derive = compressed},
+ {.derive = uncompressed},
+ {.derive = compressed},
};
vl.values = values;
/* callback = */ openvpn_read,
/* interval = */ 0,
&(user_data_t){
- .data = instance, .free_func = openvpn_free,
+ .data = instance,
+ .free_func = openvpn_free,
});
if (status == EINVAL) {
ERROR("openvpn plugin: status filename \"%s\" "
- "already used, please choose a "
- "different one.",
- status_name);
+ "already used, please choose a "
+ "different one.",
+ status_name);
return -1;
}
static int notif_severity;
static const char *config_keys[] = {
- "LogLevel", "NotifyLevel",
+ "LogLevel",
+ "NotifyLevel",
};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
notif_severity = parse_notif_severity(value);
if (notif_severity < 0)
ERROR("syslog: invalid notification severity [%s]", value);
- return 1;
+ return 1;
}
return 0;