aboutsummaryrefslogtreecommitdiffstats
path: root/cipher/rndegd.c
diff options
context:
space:
mode:
Diffstat (limited to 'cipher/rndegd.c')
-rw-r--r--cipher/rndegd.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/cipher/rndegd.c b/cipher/rndegd.c
index 4d5f0ef3a..f6870cdd6 100644
--- a/cipher/rndegd.c
+++ b/cipher/rndegd.c
@@ -1,5 +1,5 @@
/* rndegd.c - interface to the EGD
- * Copyright (C) 1999 Free Software Foundation, Inc.
+ * Copyright (C) 1999, 2000 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -117,9 +117,13 @@ do_read( int fd, void *buf, size_t nbytes )
-/* Note: we always use the highest level.
+/****************
+ * Note: we always use the highest level.
* TO boost the performance we may want to add some
* additional code for level 1
+ *
+ * Using a level of 0 should never block and better add nothing
+ * to the pool. So this is just a dummy for EGD.
*/
static int
gather_random( void (*add)(const void*, size_t, int), int requester,
@@ -133,7 +137,8 @@ gather_random( void (*add)(const void*, size_t, int), int requester,
if( !length )
return 0;
-
+ if( !level )
+ return 0;
restart:
if( do_restart ) {