[FFmpeg-cvslog] r23930 - trunk/libavutil/random_seed.c

mru subversion
Thu Jul 1 13:40:51 CEST 2010


Author: mru
Date: Thu Jul  1 13:40:50 2010
New Revision: 23930

Log:
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.

Modified:
   trunk/libavutil/random_seed.c

Modified: trunk/libavutil/random_seed.c
==============================================================================
--- trunk/libavutil/random_seed.c	Thu Jul  1 13:11:23 2010	(r23929)
+++ trunk/libavutil/random_seed.c	Thu Jul  1 13:40:50 2010	(r23930)
@@ -31,9 +31,6 @@ static int read_random(uint32_t *dst, co
 
     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);
 



More information about the ffmpeg-cvslog mailing list