Mercurial > libavutil.hg
changeset 964:08c117c60753 libavutil
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.
author | mru |
---|---|
date | Thu, 01 Jul 2010 11:40:50 +0000 |
parents | bb7159d1f769 |
children | 2acd85ae41ca |
files | random_seed.c |
diffstat | 1 files changed, 0 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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);