diff options
author | Måns Rullgård <mans@mansr.com> | 2010-07-01 11:43:30 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2010-07-01 11:43:30 +0000 |
commit | 16bfbfd0782b062219080be69b70685dbfba3ca6 (patch) | |
tree | bc3d0933077b3935f5853f26df14d56f692c7d2a /libavutil/random_seed.c | |
parent | 9958096ea2ce72590ad36540ea2e0254f60f8b09 (diff) | |
download | ffmpeg-16bfbfd0782b062219080be69b70685dbfba3ca6.tar.gz |
random_seed: simplify
Originally committed as revision 23932 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/random_seed.c')
-rw-r--r-- | libavutil/random_seed.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c index 929e8e0fb9..86c60f3838 100644 --- a/libavutil/random_seed.c +++ b/libavutil/random_seed.c @@ -40,12 +40,10 @@ static int read_random(uint32_t *dst, const char *file) uint32_t av_get_random_seed(void) { uint32_t seed; - int err; - err = read_random(&seed, "/dev/urandom"); - if (err != sizeof(seed)) - err = read_random(&seed, "/dev/random"); - if (err == sizeof(seed)) + if (read_random(&seed, "/dev/urandom") == sizeof(seed)) + return seed; + if (read_random(&seed, "/dev/random") == sizeof(seed)) return seed; #ifdef AV_READ_TIME |