diff options
author | Werner Koch <wk@gnupg.org> | 2011-09-08 10:53:12 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2011-09-08 10:53:12 +0200 |
commit | 9487099071af4478d2882e633a0ade805801d6fa (patch) | |
tree | 7226866ea3efd53f13d24c08d78907a480816e24 /random/rndunix.c | |
parent | 5e14de02b323d207151429d37f006ec30bbf7783 (diff) | |
download | libgcrypt-9487099071af4478d2882e633a0ade805801d6fa.tar.gz |
Fix a problem with select and high fds.
If on systems where the maximum number of fds may be dynamically
configured to a value of FD_MAXSIZE or higher and the RNG is first
used after more than FD_SETSIZE-1 descriptors are in use, we disable
the progress messages from the RNG. A better solution would be too
use poll but that requires more tests.
The same problem exists in rndunix.c - however this rng is only used
on old Unices and I assume that they don't feature dynamically
configured maximum fd sizes.
Diffstat (limited to 'random/rndunix.c')
-rw-r--r-- | random/rndunix.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/random/rndunix.c b/random/rndunix.c index cc5eb145..1b810d72 100644 --- a/random/rndunix.c +++ b/random/rndunix.c @@ -551,7 +551,8 @@ slow_poll(FILE *dbgfp, int dbgall, size_t *nbytes ) #else #error O_NONBLOCK is missing #endif - + /* FIXME: We need to make sure that the fd is less than + FD_SETSIZE. */ FD_SET(dataSources[i].pipeFD, &fds); dataSources[i].length = 0; |