summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/librandom/random_init.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/librandom/random_init.c b/src/librandom/random_init.c
index e47f8df..72671df 100644
--- a/src/librandom/random_init.c
+++ b/src/librandom/random_init.c
@@ -22,16 +22,10 @@ int random_init ()
#else
#ifdef SKALIBS_HASGETRANDOM
-#include <skalibs/djbunix.h>
#include <skalibs/random.h>
int random_init ()
{
-#ifdef SKALIBS_HASDEVURANDOM
- char seed[160] ;
- random_makeseed(seed) ;
- openwritenclose_unsafe("/dev/urandom", seed, 160) ;
-#endif
return 1 ;
}
@@ -66,9 +60,14 @@ int random_init ()
int random_init ()
{
- char seed[160] ;
- random_makeseed(seed) ;
- surf_init(&surf_here, seed) ;
+ static int initted = 0 ;
+ if (!initted)
+ {
+ char seed[160] ;
+ initted = 1 ;
+ random_makeseed(seed) ;
+ surf_init(&surf_here, seed) ;
+ }
return 1 ;
}