summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eaad4ca)
raw | patch | inline | side by side (parent: eaad4ca)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 6 Nov 2010 13:26:38 +0000 (14:26 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 6 Nov 2010 13:26:38 +0000 (14:26 +0100) |
src/rrdtool.c | patch | blob | history |
diff --git a/src/rrdtool.c b/src/rrdtool.c
index c948d1f803b282d0707b8daafa7d8571d61eee59..b366a9c64166eeeae135f700b069e81578cac28a 100644 (file)
--- a/src/rrdtool.c
+++ b/src/rrdtool.c
if (random_timeout <= 0)
return (0);
+ /* Assure that "cache_timeout + random_variation" is never negative. */
+ if (random_timeout > cache_timeout)
+ {
+ INFO ("rrdtool plugin: Adjusting \"RandomTimeout\" to %.3f seconds.",
+ CDTIME_T_TO_DOUBLE (cache_timeout));
+ random_timeout = cache_timeout;
+ }
+
/* This seems a bit complicated, but "random_timeout" is likely larger than
* RAND_MAX, so we can't simply use modulo here. */
dbl_timeout = CDTIME_T_TO_DOUBLE (random_timeout);