# HG changeset patch # User mru # Date 1277984450 0 # Node ID 08c117c60753243e4de45b2f6e2b53daa8376494 # Parent bb7159d1f76983a29f8e0d783b15a3738be0d526 random_seed: allow to block on /dev/random If both /dev/random and /dev/urandom failed to return data, an uninitialised value might be returned. Since most systems have a non-blocking /dev/urandom or have /dev/random with similar properties, the chance of blocking is minimal, and the alternative of returning non-random data is worse. diff -r bb7159d1f769 -r 08c117c60753 random_seed.c --- a/random_seed.c Wed Jun 30 20:09:55 2010 +0000 +++ b/random_seed.c Thu Jul 01 11:40:50 2010 +0000 @@ -31,9 +31,6 @@ if (fd == -1) return -1; -#if HAVE_FCNTL && defined(O_NONBLOCK) - if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK) != -1) -#endif err = read(fd, dst, sizeof(*dst)); close(fd);