summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-10-18 12:41:36 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-10-18 18:48:49 +0200
commit300a743048de760e3a5456e8dce549af5f42b11b (patch)
tree470fef6bf786c8531524ec2607e1239921e662d9 /comphelper
parent86e07d951bc4fd16648fe10befb40dd953fcc208 (diff)
make RR easier to use
breaks easily without the RNG being repeatable Change-Id: Ia464a04f0623668088564c7121f39f04aa68b2ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123740 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/misc/random.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/comphelper/source/misc/random.cxx b/comphelper/source/misc/random.cxx
index c8c87888bcae..96d466641dfb 100644
--- a/comphelper/source/misc/random.cxx
+++ b/comphelper/source/misc/random.cxx
@@ -42,7 +42,8 @@ struct RandomNumberGenerator
STD_RNG_ALGO global_rng;
RandomNumberGenerator()
{
- bool bRepeatable = (getenv("SAL_RAND_REPEATABLE") != nullptr);
+ // make RR easier to use, breaks easily without the RNG being repeatable
+ bool bRepeatable = (getenv("SAL_RAND_REPEATABLE") != nullptr) || (getenv("RR") != nullptr);
// valgrind on some platforms (e.g.Ubuntu16.04) does not support the new Intel RDRAND instructions,
// which leads to "Illegal Opcode" errors, so just turn off randomness.
#if defined HAVE_VALGRIND_HEADERS