openbsd-ports/net/ldns/libldns/patches/patch-util_c
2011-05-31 17:40:49 +00:00

19 lines
796 B
Plaintext

$OpenBSD: patch-util_c,v 1.7 2011/05/31 17:40:50 jakob Exp $
--- util.c.orig Wed May 18 16:15:05 2011
+++ util.c Tue May 31 19:39:46 2011
@@ -369,10 +369,10 @@ ldns_init_random(FILE *fd, unsigned int size)
}
if (!fd) {
- if ((rand_f = fopen("/dev/urandom", "r")) == NULL) {
- /* no readable /dev/urandom, try /dev/random */
- if ((rand_f = fopen("/dev/random", "r")) == NULL) {
- /* no readable /dev/random either, and no entropy
+ if ((rand_f = fopen("/dev/arandom", "r")) == NULL) {
+ /* no readable /dev/arandom, try /dev/urandom */
+ if ((rand_f = fopen("/dev/urandom", "r")) == NULL) {
+ /* no readable /dev/urandom either, and no entropy
source given. we'll have to improvise */
for (read = 0; read < size; read++) {
gettimeofday(&tv, NULL);