X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fgmond.c;h=ca654194f6d277c9bacc4c2c758aefcd65dca018;hp=09f94ae77fd2dbcbd53477d26f1cd862eba511a9;hb=06a86a60a7dabc685bdbd81ce3d36ea5f7e2c2d4;hpb=0b7cd83a5e6bac068ea83a88a5ddcfb07c09fbec diff --git a/src/gmond.c b/src/gmond.c index 09f94ae7..ca654194 100644 --- a/src/gmond.c +++ b/src/gmond.c @@ -84,19 +84,19 @@ struct metric_map_s { typedef struct metric_map_s metric_map_t; #define MC_RECEIVE_GROUP_DEFAULT "239.2.11.71" -static char *mc_receive_group = NULL; +static char *mc_receive_group; #define MC_RECEIVE_PORT_DEFAULT "8649" -static char *mc_receive_port = NULL; +static char *mc_receive_port; -static struct pollfd *mc_receive_sockets = NULL; -static size_t mc_receive_sockets_num = 0; +static struct pollfd *mc_receive_sockets; +static size_t mc_receive_sockets_num; -static socket_entry_t *mc_send_sockets = NULL; -static size_t mc_send_sockets_num = 0; +static socket_entry_t *mc_send_sockets; +static size_t mc_send_sockets_num; static pthread_mutex_t mc_send_sockets_lock = PTHREAD_MUTEX_INITIALIZER; -static int mc_receive_thread_loop = 0; -static int mc_receive_thread_running = 0; +static int mc_receive_thread_loop; +static int mc_receive_thread_running; static pthread_t mc_receive_thread_id; static metric_map_t metric_map_default[] = @@ -122,8 +122,8 @@ static metric_map_t metric_map_default[] = {"pkts_out", "if_packets", "", "tx", -1, -1}}; static size_t metric_map_len_default = STATIC_ARRAY_SIZE(metric_map_default); -static metric_map_t *metric_map = NULL; -static size_t metric_map_len = 0; +static metric_map_t *metric_map; +static size_t metric_map_len; static c_avl_tree_t *staging_tree; static pthread_mutex_t staging_lock = PTHREAD_MUTEX_INITIALIZER; @@ -454,7 +454,8 @@ static int staging_entry_update(const char *host, const char *name, /* {{{ */ } if (ds->ds_num <= ds_index) { - ERROR("gmond plugin: Invalid index %zu: %s has only %zu data source(s).", + ERROR("gmond plugin: Invalid index %" PRIsz ": %s has only %" PRIsz + " data source(s).", ds_index, ds->type, ds->ds_num); return -1; }