X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrdtool.c;h=1f354218624518f1af702171d672c6d1be351b72;hb=8e5e2e927f9cf051ef210473b1b48ff62d81f585;hp=885636929fd01b88bdfca2b0b24badb9040cca0d;hpb=a18496a4ac759552fd4dac1d2c661fb50285b1a1;p=collectd.git diff --git a/src/rrdtool.c b/src/rrdtool.c index 88563692..1f354218 100644 --- a/src/rrdtool.c +++ b/src/rrdtool.c @@ -620,9 +620,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); @@ -1036,8 +1035,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));