Use poll(2) to wait for rnd(4). The initialisation of OpenSSL's RNG
now works reliably if the first FD_SETSIZE file descriptors are in use.
This commit is contained in:
parent
b698472136
commit
6dda4e3f48
4
crypto/dist/openssl/crypto/rand/rand_unix.c
vendored
4
crypto/dist/openssl/crypto/rand/rand_unix.c
vendored
@ -125,7 +125,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#if defined(OPENSSL_SYS_LINUX) /* should actually be available virtually everywhere */
|
||||
#if defined(OPENSSL_SYS_LINUX) || defined(__NetBSD__) /* should actually be available virtually everywhere */
|
||||
# include <poll.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
@ -211,7 +211,7 @@ int RAND_poll(void)
|
||||
{
|
||||
int try_read = 0;
|
||||
|
||||
#if defined(OPENSSL_SYS_LINUX)
|
||||
#if defined(OPENSSL_SYS_LINUX) || defined(__NetBSD__)
|
||||
/* use poll() */
|
||||
struct pollfd pset;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user