X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Frrdtool.c;h=cd275dadc622bd92c18943edecf7da245e10d247;hb=7111bb6df7628edce3a8e538b386fbe27633a191;hp=558b80051428165d85d97458b32600487f7ea080;hpb=b637934677634886383916c417e1be148ee0c7ad;p=collectd.git diff --git a/src/rrdtool.c b/src/rrdtool.c index 558b8005..cd275dad 100644 --- a/src/rrdtool.c +++ b/src/rrdtool.c @@ -623,9 +623,8 @@ static int rrd_cache_insert(const char *filename, const char *value, return -1; } - c_avl_get(cache, filename, (void *)&rc); - - if (rc == NULL) { + int status = c_avl_get(cache, filename, (void *)&rc); + if ((status != 0) || (rc == NULL)) { rc = malloc(sizeof(*rc)); if (rc == NULL) { pthread_mutex_unlock(&cache_lock); @@ -1047,8 +1046,7 @@ static int rrd_init(void) { cache_flush_timeout = 0; } else if (cache_flush_timeout < cache_timeout) { INFO("rrdtool plugin: \"CacheFlush %.3f\" is less than \"CacheTimeout " - "%.3f\". " - "Ajusting \"CacheFlush\" to %.3f seconds.", + "%.3f\". Adjusting \"CacheFlush\" to %.3f seconds.", CDTIME_T_TO_DOUBLE(cache_flush_timeout), CDTIME_T_TO_DOUBLE(cache_timeout), CDTIME_T_TO_DOUBLE(cache_timeout * 10));