skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

commit 495da13c70f50ee5224873a04a47d1f957e3b6f0
parent 7a05ff287d2d3a40d6d88b43a61b459f0120c26e
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date:   Thu,  3 Nov 2016 10:25:24 +0000

 random_init: do not fail if we can't write to /dev/urandom

Diffstat:
Msrc/librandom/random_init.c | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/librandom/random_init.c b/src/librandom/random_init.c @@ -27,10 +27,9 @@ int random_init () #ifdef SKALIBS_HASDEVURANDOM char seed[160] ; random_makeseed(seed) ; - return openwritenclose_unsafe("/dev/urandom", seed, 160) ; -#else - return 1 ; + openwritenclose_unsafe("/dev/urandom", seed, 160) ; #endif + return 1 ; } #else @@ -54,7 +53,7 @@ int random_init () char seed[160] ; random_makeseed(seed) ; surf_init(&surf_here, seed) ; - if (!openwritenclose_unsafe("/dev/urandom", seed, 160)) return 0 ; + openwritenclose_unsafe("/dev/urandom", seed, 160) ; if (random_fd < 0) { fd = open_readb("/dev/urandom") ;