diff options
Diffstat (limited to 'cipher/rndunix.c')
-rw-r--r-- | cipher/rndunix.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cipher/rndunix.c b/cipher/rndunix.c index 46f80eab2..9f60b3cf8 100644 --- a/cipher/rndunix.c +++ b/cipher/rndunix.c @@ -716,6 +716,10 @@ read_a_msg( int fd, GATHER_MSG *msg ) } +/**************** + * Using a level of 0 should never block and better add nothing + * to the pool. So this is just a dummy for this gatherer. + */ static int gather_random( void (*add)(const void*, size_t, int), int requester, size_t length, int level ) @@ -725,6 +729,9 @@ gather_random( void (*add)(const void*, size_t, int), int requester, GATHER_MSG msg; size_t n; + if( !level ) + return 0; + if( !gatherer_pid ) { /* make sure we are not setuid */ if( getuid() != geteuid() ) |