From 8be9590f78d0f7cf04ade6a2ff0bddd365e3fd7c Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sun, 16 Oct 2016 21:14:00 +0000 Subject: Fix headers in random_init.c; add a workaround for (pathological) getrandom() without /dev/urandom --- src/librandom/random_init.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/librandom') diff --git a/src/librandom/random_init.c b/src/librandom/random_init.c index 18bb8fa..6a30db1 100644 --- a/src/librandom/random_init.c +++ b/src/librandom/random_init.c @@ -24,15 +24,20 @@ int random_init () int random_init () { +#ifdef SKALIBS_HASDEVURANDOM char seed[160] ; random_makeseed(seed) ; return openwritenclose_unsafe("/dev/urandom", seed, 160) ; +#else + return 1 ; +#endif } #else #ifdef SKALIBS_HASDEVURANDOM #include +#include #include #include "random-internal.h" @@ -58,6 +63,7 @@ int random_init () #else /* default */ +#include #include #include "random-internal.h" -- cgit v1.2.3