X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fstatsd.c;h=444e8ea119c2b6ff2087f0eeabcb46eba66861f8;hb=1df1a595017f4adfd159f7a923a721a2e83fd682;hp=c7b472f157f1bab8fdba8b7cb863581864e69089;hpb=6e41c3b1f024d7944e5e8010a87933555c662474;p=collectd.git diff --git a/src/statsd.c b/src/statsd.c index c7b472f1..444e8ea1 100644 --- a/src/statsd.c +++ b/src/statsd.c @@ -61,22 +61,22 @@ struct statsd_metric_s { }; typedef struct statsd_metric_s statsd_metric_t; -static c_avl_tree_t *metrics_tree = NULL; +static c_avl_tree_t *metrics_tree; static pthread_mutex_t metrics_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_t network_thread; static bool network_thread_running; static bool network_thread_shutdown; -static char *conf_node = NULL; -static char *conf_service = NULL; +static char *conf_node; +static char *conf_service; static bool conf_delete_counters; static bool conf_delete_timers; static bool conf_delete_gauges; static bool conf_delete_sets; -static double *conf_timer_percentile = NULL; +static double *conf_timer_percentile; static size_t conf_timer_percentile_num; static bool conf_counter_sum; @@ -352,9 +352,8 @@ static int statsd_handle_set(char const *name, /* {{{ */ status = c_avl_insert(metric->set, set_key, /* value = */ NULL); if (status < 0) { pthread_mutex_unlock(&metrics_lock); - if (status < 0) - ERROR("statsd plugin: c_avl_insert (\"%s\") failed with status %i.", - set_key, status); + ERROR("statsd plugin: c_avl_insert (\"%s\") failed with status %i.", + set_key, status); sfree(set_key); return -1; } else if (status > 0) /* key already exists */