X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrdtool.c;h=4fcbad409aed5768613c6f9219a4c0226fde66e6;hb=06c1d153c58a1510674c20d886baa148ab08b3bc;hp=82f570f4a21edcbffddb685be193dbd08a0fe6d5;hpb=45492ba3d0119874e2f2878d68089fc8f62268a4;p=collectd.git diff --git a/src/rrdtool.c b/src/rrdtool.c index 82f570f4..4fcbad40 100644 --- a/src/rrdtool.c +++ b/src/rrdtool.c @@ -627,9 +627,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); @@ -1054,8 +1053,8 @@ static int rrd_init(void) { random_timeout = 0; 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.", + INFO("rrdtool plugin: \"CacheFlush %.3f\" is less than \"CacheTimeout " + "%.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));