openbsd-ports/devel/uuid/patches/patch-uuid_prng_c

16 lines
577 B
Plaintext
Raw Normal View History

2010-08-26 05:25:20 -04:00
$OpenBSD: patch-uuid_prng_c,v 1.2 2010/08/26 09:25:20 kevlo Exp $
2010-03-21 06:46:43 -04:00
/dev/arandom is prefered over /dev/urandom.
2010-08-26 05:25:20 -04:00
--- uuid_prng.c.orig Tue Jun 3 13:59:53 2008
+++ uuid_prng.c Wed Aug 25 17:25:59 2010
@@ -74,7 +74,7 @@ prng_rc_t prng_create(prng_t **prng)
2010-03-21 06:46:43 -04:00
/* try to open the system PRNG device */
(*prng)->dev = -1;
2010-08-26 05:25:20 -04:00
#if !defined(WIN32)
2010-03-21 06:46:43 -04:00
- if ((fd = open("/dev/urandom", O_RDONLY)) == -1)
+ if ((fd = open("/dev/arandom", O_RDONLY)) == -1)
fd = open("/dev/random", O_RDONLY|O_NONBLOCK);
if (fd != -1) {
(void)fcntl(fd, F_SETFD, FD_CLOEXEC);