diff options
| author | J08nY | 2017-07-20 03:46:29 +0200 |
|---|---|---|
| committer | J08nY | 2017-07-20 03:46:29 +0200 |
| commit | abfe04cf03afeec53d50a01c7028b873e3efcb53 (patch) | |
| tree | 4abf1ffc1fd44ba5c2e071c4c7548238d64bb0a8 /src/util/random.c | |
| parent | 84c8a246ffb870bce8bafc5ba03116b82c5ebfb7 (diff) | |
| download | ecgen-abfe04cf03afeec53d50a01c7028b873e3efcb53.tar.gz ecgen-abfe04cf03afeec53d50a01c7028b873e3efcb53.tar.zst ecgen-abfe04cf03afeec53d50a01c7028b873e3efcb53.zip | |
Diffstat (limited to 'src/util/random.c')
| -rw-r--r-- | src/util/random.c | 6 |
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; } |
