Commit 16bfbfd0 authored by Måns Rullgård's avatar Måns Rullgård

random_seed: simplify

Originally committed as revision 23932 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 9958096e
...@@ -40,12 +40,10 @@ static int read_random(uint32_t *dst, const char *file) ...@@ -40,12 +40,10 @@ static int read_random(uint32_t *dst, const char *file)
uint32_t av_get_random_seed(void) uint32_t av_get_random_seed(void)
{ {
uint32_t seed; uint32_t seed;
int err;
err = read_random(&seed, "/dev/urandom"); if (read_random(&seed, "/dev/urandom") == sizeof(seed))
if (err != sizeof(seed)) return seed;
err = read_random(&seed, "/dev/random"); if (read_random(&seed, "/dev/random") == sizeof(seed))
if (err == sizeof(seed))
return seed; return seed;
#ifdef AV_READ_TIME #ifdef AV_READ_TIME
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment