aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/ztest/ztest.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/ztest/ztest.c')
-rw-r--r--cmd/ztest/ztest.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c
index 89ef1c415..f07e11c83 100644
--- a/cmd/ztest/ztest.c
+++ b/cmd/ztest/ztest.c
@@ -7064,7 +7064,12 @@ main(int argc, char **argv)
exit(EXIT_FAILURE);
}
- ztest_fd_rand = open("/dev/urandom", O_RDONLY);
+ /*
+ * Force random_get_bytes() to use /dev/urandom in order to prevent
+ * ztest from needlessly depleting the system entropy pool.
+ */
+ random_path = "/dev/urandom";
+ ztest_fd_rand = open(random_path, O_RDONLY);
ASSERT3S(ztest_fd_rand, >=, 0);
if (!fd_data_str) {