X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Frrdtool.c;h=84fcceff9d76d3217ad0dbc110a8ca6ec9ee9953;hp=2a1a569888bd2fc6b100b2dd9e392d6356533d21;hb=20115ea505208ac2f1e8b453a35284b871db1321;hpb=c7cbb2af24de8b33186dd45b5731b87ea7152173 diff --git a/src/rrdtool.c b/src/rrdtool.c index 2a1a5698..84fcceff 100644 --- a/src/rrdtool.c +++ b/src/rrdtool.c @@ -605,9 +605,6 @@ static int rrd_cache_flush_identifier(cdtime_t timeout, } /* int rrd_cache_flush_identifier */ static int64_t rrd_get_random_variation(void) { - long min; - long max; - if (random_timeout == 0) return (0); @@ -618,10 +615,7 @@ static int64_t rrd_get_random_variation(void) { random_timeout = cache_timeout; } - max = (long)(random_timeout / 2); - min = max - ((long)random_timeout); - - return ((int64_t)cdrand_range(min, max)); + return (int64_t)cdrand_range(-random_timeout, random_timeout); } /* int64_t rrd_get_random_variation */ static int rrd_cache_insert(const char *filename, const char *value,