diff options
author | Brian Behlendorf <[email protected]> | 2018-01-12 09:36:26 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2018-01-12 09:36:26 -0800 |
commit | e1a0850c3570ae53df5779bc656f17b98b86f160 (patch) | |
tree | d17b3ab882718b22d049cd07e7581eda2f76af7a /lib/libzpool/kernel.c | |
parent | 6df9f8ebd73c05da627144bcc3823e6fe980cd75 (diff) |
Force ztest to always use /dev/urandom
For ztest, which is solely for testing, using a pseudo random
is entirely reasonable. Using /dev/urandom ensures the system
entropy pool doesn't get depleted thus stalling the testing.
This is a particular problem when testing in VMs.
Reviewed-by: Tim Chase <[email protected]>
Reviewed by: Thomas Caputi <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #7017
Closes #7036
Diffstat (limited to 'lib/libzpool/kernel.c')
-rw-r--r-- | lib/libzpool/kernel.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libzpool/kernel.c b/lib/libzpool/kernel.c index c4b600d03..09e69ef6d 100644 --- a/lib/libzpool/kernel.c +++ b/lib/libzpool/kernel.c @@ -907,13 +907,15 @@ lowbit64(uint64_t i) return (__builtin_ffsll(i)); } +char *random_path = "/dev/random"; +char *urandom_path = "/dev/urandom"; static int random_fd = -1, urandom_fd = -1; void random_init(void) { - VERIFY((random_fd = open("/dev/random", O_RDONLY)) != -1); - VERIFY((urandom_fd = open("/dev/urandom", O_RDONLY)) != -1); + VERIFY((random_fd = open(random_path, O_RDONLY)) != -1); + VERIFY((urandom_fd = open(urandom_path, O_RDONLY)) != -1); } void |