aboutsummaryrefslogtreecommitdiff
path: root/src/util/random.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/random.c')
-rw-r--r--src/util/random.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util/random.c b/src/util/random.c
index 519ce6b..bd7b89b 100644
--- a/src/util/random.c
+++ b/src/util/random.c
@@ -7,7 +7,7 @@
#include "random.h"
#include <time.h>
-bool random_init(void) {
+void random_reseed(void) {
pari_ulong seed = 0;
// Try urandom first
FILE *rand = fopen("/dev/urandom", "rb");
@@ -32,6 +32,10 @@ bool random_init(void) {
pari_sp ltop = avma;
setrand(utoi(seed));
avma = ltop;
+}
+
+bool random_init(void) {
+ random_reseed();
return true;
}