diff options
Diffstat (limited to 'src/core/random.c')
-rw-r--r-- | src/core/random.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/random.c b/src/core/random.c index 975a03c..e325196 100644 --- a/src/core/random.c +++ b/src/core/random.c @@ -6,8 +6,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); +#include <stddef.h> #include <stdlib.h> -#include <ipxe/timer.h> +#include <time.h> static int32_t rnd_seed = 0; @@ -30,8 +31,9 @@ void srandom ( unsigned int seed ) { long int random ( void ) { int32_t q; - if ( ! rnd_seed ) /* Initialize linear congruential generator */ - srandom ( currticks() ); + /* Initialize linear congruential generator */ + if ( ! rnd_seed ) + srandom ( time ( NULL ) ); /* simplified version of the LCG given in Bruce Schneier's "Applied Cryptography" */ |