提交 b7fa5c5a 编写于 作者: M Måns Rullgård

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
上级 a158446b
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册