X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fdaemon%2Futils_cache.c;h=3386df9a31c13a2d0905873c90171b4a336ddda7;hb=7173100796caa3ce86d373245767e3d185d09817;hp=fe0e083e43aabb44832acf0ef5312f41e91bf29d;hpb=ffaf9b893b6042a76e1c0dadd83ce06904fcc89a;p=collectd.git diff --git a/src/daemon/utils_cache.c b/src/daemon/utils_cache.c index fe0e083e..3386df9a 100644 --- a/src/daemon/utils_cache.c +++ b/src/daemon/utils_cache.c @@ -222,8 +222,6 @@ int uc_init(void) { } /* int uc_init */ int uc_check_timeout(void) { - cdtime_t now = cdtime(); - struct { char *key; cdtime_t time; @@ -232,6 +230,7 @@ int uc_check_timeout(void) { size_t expired_num = 0; pthread_mutex_lock(&cache_lock); + cdtime_t now = cdtime(); /* Build a list of entries to be flushed */ c_avl_iterator_t *iter = c_avl_get_iterator(cache_tree); @@ -466,7 +465,7 @@ gauge_t *uc_get_rate(const data_set_t *ds, const value_list_t *vl) { /* This is important - the caller has no other way of knowing how many * values are returned. */ - if (ret_num != (size_t)ds->ds_num) { + if (ret_num != ds->ds_num) { ERROR("utils_cache: uc_get_rate: ds[%s] has %zu values, " "but uc_get_rate_by_name returned %zu.", ds->type, ds->ds_num, ret_num);