diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2016-11-03 10:25:24 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2016-11-03 10:25:24 +0000 |
commit | 495da13c70f50ee5224873a04a47d1f957e3b6f0 (patch) | |
tree | ac44c4d678075ed17160cfecb43ccc0159811637 /src | |
parent | 7a05ff287d2d3a40d6d88b43a61b459f0120c26e (diff) | |
download | skalibs-495da13c70f50ee5224873a04a47d1f957e3b6f0.tar.xz |
random_init: do not fail if we can't write to /dev/urandom
Diffstat (limited to 'src')
-rw-r--r-- | src/librandom/random_init.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/librandom/random_init.c b/src/librandom/random_init.c index 4c9fce7..3ab5b08 100644 --- 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") ; |