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;
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);
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);
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;
#include "common.h"
#include "plugin.h"
-#include <poll.h>
#include "utils_dns.h"
+#include <poll.h>
#include <pcap.h>
return 1;
ip_chain_t temp = {0};
- ip_chain_t * final, **list;
+ ip_chain_t *final, **list;
char *table;
int table_len;
char *chain;
}
chain_list = list;
- final = malloc(sizeof(* final));
+ final = malloc(sizeof(*final));
if (final == NULL) {
ERROR("malloc failed: %s", STRERRNO);
sfree(temp.rule.comment);
/* 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
}
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 */
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;
} 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;
/* 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\" "
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;
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;
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;
return 0;
} /* }}} int swap_read */
- /* #endif KERNEL_LINUX */
+/* #endif KERNEL_LINUX */
/*
* Under Solaris, two mechanisms can be used to read swap statistics, swapctl
* Sebastian 'tokkee' Harl <sh at tokkee.org>
**/
-#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 <stdbool.h>
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!"
} 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;
#include "collectd.h"
+#include "common.h"
+#include "plugin.h"
+#include "utils_cache.h"
#include <arpa/inet.h>
#include <errno.h>
#include <inttypes.h>
#include <netdb.h>
#include <stddef.h>
-#include "common.h"
-#include "plugin.h"
-#include "utils_cache.h"
#include <stdlib.h>
#define SENSU_HOST "localhost"