From 495da13c70f50ee5224873a04a47d1f957e3b6f0 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 3 Nov 2016 10:25:24 +0000 Subject: random_init: do not fail if we can't write to /dev/urandom --- src/librandom/random_init.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/librandom') 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") ; -- cgit v1.2.3