diff options
author | Måns Rullgård <mans@mansr.com> | 2010-07-01 11:40:50 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2010-07-01 11:40:50 +0000 |
commit | b7fa5c5abb39f819fbb42253711bc13e5cac0e81 (patch) | |
tree | 65ad4cab2ec87f5aae8607efc6a112177c156060 /libavutil | |
parent | a158446b2842143a1ea0a284952571435c9ad3c4 (diff) | |
download | ffmpeg-b7fa5c5abb39f819fbb42253711bc13e5cac0e81.tar.gz |
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.
Originally committed as revision 23930 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/random_seed.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c index a2b388549c..b9222fc3ac 100644 --- a/libavutil/random_seed.c +++ b/libavutil/random_seed.c @@ -31,9 +31,6 @@ static int read_random(uint32_t *dst, const char *file) 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); |