From ab9211b7c751c7811f5eeb13384525cb5ed22762 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 6 Nov 2017 20:54:05 +0100 Subject: [PATCH] Reformat changed files. --- src/amqp.c | 9 +++++---- src/barometer.c | 2 -- src/daemon/configfile.c | 11 ++++++----- src/dns.c | 2 +- src/iptables.c | 4 ++-- src/memcached.c | 7 ++++--- src/mqtt.c | 7 ++++--- src/network.c | 16 ++++++++-------- src/openvpn.c | 7 ++++--- src/routeros.c | 6 ++---- src/statsd.c | 5 +++-- src/swap.c | 2 +- src/utils_cmds.c | 2 +- src/utils_mount.c | 1 - src/utils_rrdcreate.c | 10 +++++----- src/write_sensu.c | 6 +++--- 16 files changed, 49 insertions(+), 48 deletions(-) diff --git a/src/amqp.c b/src/amqp.c index 96a7510c..a8df8881 100644 --- a/src/amqp.c +++ b/src/amqp.c @@ -972,10 +972,11 @@ static int camqp_config_connection(oconfig_item_t *ci, /* {{{ */ char cbname[128]; snprintf(cbname, sizeof(cbname), "amqp/%s", conf->name); - status = plugin_register_write( - cbname, camqp_write, &(user_data_t){ - .data = conf, .free_func = camqp_config_free, - }); + status = + plugin_register_write(cbname, camqp_write, + &(user_data_t){ + .data = conf, .free_func = camqp_config_free, + }); if (status != 0) { camqp_config_free(conf); return status; diff --git a/src/barometer.c b/src/barometer.c index 8729cdfb..2db1ea41 100644 --- a/src/barometer.c +++ b/src/barometer.c @@ -547,7 +547,6 @@ static int MPL115_read_coeffs(void) { int8_t sic12MSB, sic12LSB, sic11MSB, sic11LSB, sic22MSB, sic22LSB; int16_t sia0, sib1, sib2, sic12, sic11, sic22; - res = i2c_smbus_read_i2c_block_data(i2c_bus_fd, MPL115_ADDR_COEFFS, STATIC_ARRAY_SIZE(mpl115_coeffs), mpl115_coeffs); @@ -1127,7 +1126,6 @@ static int BMP085_read(double *pressure, double *temperature) { long adc_pressure; long adc_temperature; - /* start conversion of temperature */ res = i2c_smbus_write_byte_data(i2c_bus_fd, BMP085_ADDR_CTRL_REG, BMP085_CMD_CONVERT_TEMP); diff --git a/src/daemon/configfile.c b/src/daemon/configfile.c index 597779d1..e61128eb 100644 --- a/src/daemon/configfile.c +++ b/src/daemon/configfile.c @@ -461,9 +461,9 @@ static int cf_ci_replace_child(oconfig_item_t *dst, oconfig_item_t *src, 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; @@ -502,8 +502,9 @@ static int cf_ci_append_children(oconfig_item_t *dst, oconfig_item_t *src) { 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; diff --git a/src/dns.c b/src/dns.c index f34dafff..3ab456b5 100644 --- a/src/dns.c +++ b/src/dns.c @@ -29,8 +29,8 @@ #include "common.h" #include "plugin.h" -#include #include "utils_dns.h" +#include #include diff --git a/src/iptables.c b/src/iptables.c index 2dddacca..bc75d7bc 100644 --- a/src/iptables.c +++ b/src/iptables.c @@ -101,7 +101,7 @@ static int iptables_config(const char *key, const char *value) { return 1; ip_chain_t temp = {0}; - ip_chain_t * final, **list; + ip_chain_t *final, **list; char *table; int table_len; char *chain; @@ -187,7 +187,7 @@ static int iptables_config(const char *key, const char *value) { } chain_list = list; - final = malloc(sizeof(* final)); + final = malloc(sizeof(*final)); if (final == NULL) { ERROR("malloc failed: %s", STRERRNO); sfree(temp.rule.comment); diff --git a/src/memcached.c b/src/memcached.c index d91454a2..d62b25d2 100644 --- a/src/memcached.c +++ b/src/memcached.c @@ -677,9 +677,10 @@ static int memcached_add_read_callback(memcached_t *st) { /* group = */ "memcached", /* name = */ callback_name, /* callback = */ memcached_read, - /* interval = */ 0, &(user_data_t){ - .data = st, .free_func = memcached_free, - }); + /* interval = */ 0, + &(user_data_t){ + .data = st, .free_func = memcached_free, + }); } /* int memcached_add_read_callback */ /* Configuration handling functiions diff --git a/src/mqtt.c b/src/mqtt.c index 94698375..d134c381 100644 --- a/src/mqtt.c +++ b/src/mqtt.c @@ -600,9 +600,10 @@ static int mqtt_config_publisher(oconfig_item_t *ci) { } snprintf(cb_name, sizeof(cb_name), "mqtt/%s", conf->name); - plugin_register_write(cb_name, mqtt_write, &(user_data_t){ - .data = conf, - }); + plugin_register_write(cb_name, mqtt_write, + &(user_data_t){ + .data = conf, + }); return 0; } /* mqtt_config_publisher */ diff --git a/src/network.c b/src/network.c index 0a03d72e..e5b8b3a8 100644 --- a/src/network.c +++ b/src/network.c @@ -2617,10 +2617,10 @@ static int network_write(const data_set_t *ds, const value_list_t *vl, pthread_mutex_lock(&send_buffer_lock); - status = - add_to_buffer(send_buffer_ptr, network_config_packet_size - - (send_buffer_fill + BUFF_SIG_SIZE), - &send_buffer_vl, ds, vl); + status = add_to_buffer(send_buffer_ptr, + network_config_packet_size - + (send_buffer_fill + BUFF_SIG_SIZE), + &send_buffer_vl, ds, vl); if (status >= 0) { /* status == bytes added to the buffer */ send_buffer_fill += status; @@ -2631,10 +2631,10 @@ static int network_write(const data_set_t *ds, const value_list_t *vl, } else { flush_buffer(); - status = - add_to_buffer(send_buffer_ptr, network_config_packet_size - - (send_buffer_fill + BUFF_SIG_SIZE), - &send_buffer_vl, ds, vl); + status = add_to_buffer(send_buffer_ptr, + network_config_packet_size - + (send_buffer_fill + BUFF_SIG_SIZE), + &send_buffer_vl, ds, vl); if (status >= 0) { send_buffer_fill += status; diff --git a/src/openvpn.c b/src/openvpn.c index 71f622b0..608bef60 100644 --- a/src/openvpn.c +++ b/src/openvpn.c @@ -500,9 +500,10 @@ static int openvpn_config(const char *key, const char *value) { /* group = */ "openvpn", /* name = */ callback_name, /* callback = */ openvpn_read, - /* interval = */ 0, &(user_data_t){ - .data = instance, .free_func = openvpn_free, - }); + /* interval = */ 0, + &(user_data_t){ + .data = instance, .free_func = openvpn_free, + }); if (status == EINVAL) { WARNING("openvpn plugin: status filename \"%s\" " diff --git a/src/routeros.c b/src/routeros.c index 6c48826f..ec8956ca 100644 --- a/src/routeros.c +++ b/src/routeros.c @@ -89,8 +89,7 @@ static void submit_interface(cr_data_t *rd, /* {{{ */ static int handle_interface(__attribute__((unused)) ros_connection_t *c, /* {{{ */ - const ros_interface_t *i, - void *user_data) { + const ros_interface_t *i, void *user_data) { if ((i == NULL) || (user_data == NULL)) return EINVAL; @@ -171,8 +170,7 @@ static void submit_regtable(cr_data_t *rd, /* {{{ */ static int handle_regtable(__attribute__((unused)) ros_connection_t *c, /* {{{ */ - const ros_registration_table_t *r, - void *user_data) { + const ros_registration_table_t *r, void *user_data) { if ((r == NULL) || (user_data == NULL)) return EINVAL; diff --git a/src/statsd.c b/src/statsd.c index 4a6c09a8..ccd15ebe 100644 --- a/src/statsd.c +++ b/src/statsd.c @@ -597,8 +597,9 @@ static int statsd_config_timer_percentile(oconfig_item_t *ci) /* {{{ */ return ERANGE; } - tmp = realloc(conf_timer_percentile, sizeof(*conf_timer_percentile) * - (conf_timer_percentile_num + 1)); + tmp = + realloc(conf_timer_percentile, + sizeof(*conf_timer_percentile) * (conf_timer_percentile_num + 1)); if (tmp == NULL) { ERROR("statsd plugin: realloc failed."); return ENOMEM; diff --git a/src/swap.c b/src/swap.c index 1b873e5d..dfca67b4 100644 --- a/src/swap.c +++ b/src/swap.c @@ -409,7 +409,7 @@ static int swap_read(void) /* {{{ */ return 0; } /* }}} int swap_read */ - /* #endif KERNEL_LINUX */ +/* #endif KERNEL_LINUX */ /* * Under Solaris, two mechanisms can be used to read swap statistics, swapctl diff --git a/src/utils_cmds.c b/src/utils_cmds.c index c1fdeb41..fe57d5a2 100644 --- a/src/utils_cmds.c +++ b/src/utils_cmds.c @@ -26,12 +26,12 @@ * Sebastian 'tokkee' Harl **/ -#include "utils_cmds.h" #include "daemon/common.h" #include "utils_cmd_flush.h" #include "utils_cmd_getval.h" #include "utils_cmd_listval.h" #include "utils_cmd_putval.h" +#include "utils_cmds.h" #include "utils_parse_option.h" #include diff --git a/src/utils_mount.c b/src/utils_mount.c index 2cab4817..b8af367e 100644 --- a/src/utils_mount.c +++ b/src/utils_mount.c @@ -519,7 +519,6 @@ static cu_mount_t *cu_mount_gen_getmntent(void) { return first; } /* static cu_mount_t *cu_mount_gen_getmntent (void) */ -/* #endif HAVE_TWO_GETMNTENT || HAVE_GEN_GETMNTENT || HAVE_SUN_GETMNTENT */ #elif HAVE_SEQ_GETMNTENT #warn "This version of `getmntent' hat not yet been implemented!" diff --git a/src/utils_rrdcreate.c b/src/utils_rrdcreate.c index 92cecd03..ef126012 100644 --- a/src/utils_rrdcreate.c +++ b/src/utils_rrdcreate.c @@ -285,11 +285,11 @@ static int ds_get(char ***ret, /* {{{ */ } else snprintf(max, sizeof(max), "%f", d->max); - status = snprintf(buffer, sizeof(buffer), "DS:%s:%s:%i:%s:%s", d->name, - type, (cfg->heartbeat > 0) - ? cfg->heartbeat - : (int)CDTIME_T_TO_TIME_T(2 * vl->interval), - min, max); + status = snprintf( + buffer, sizeof(buffer), "DS:%s:%s:%i:%s:%s", d->name, type, + (cfg->heartbeat > 0) ? cfg->heartbeat + : (int)CDTIME_T_TO_TIME_T(2 * vl->interval), + min, max); if ((status < 1) || ((size_t)status >= sizeof(buffer))) break; diff --git a/src/write_sensu.c b/src/write_sensu.c index 4eeb822c..a34f0cf9 100644 --- a/src/write_sensu.c +++ b/src/write_sensu.c @@ -28,14 +28,14 @@ #include "collectd.h" +#include "common.h" +#include "plugin.h" +#include "utils_cache.h" #include #include #include #include #include -#include "common.h" -#include "plugin.h" -#include "utils_cache.h" #include #define SENSU_HOST "localhost" -- 2.11.0