Merge branch 'org.openembedded.dev' of git@git.openembedded.net:openembedded into...
[openembedded.git] / recipes / mozilla / firefox-3.0.1 / random_to_urandom.diff
1 # Component manager should not use /dev/random for generation ranodm numbers
2 # It cause hangs on embedding platforms,which does not have enough devices for generation required entropy
3 # Bug somewhere exists but it is very old
4 Index: nsprpub/pr/src/md/unix/uxrng.c
5 ===================================================================
6 --- mozilla/nsprpub/pr/src/md/unix/uxrng.c.orig
7 +++ mozilla/nsprpub/pr/src/md/unix/uxrng.c
8 @@ -144,17 +144,17 @@
9  #include <sys/stat.h>
10  #include <fcntl.h>
11  
12  static int      fdDevRandom;
13  static PRCallOnceType coOpenDevRandom;
14  
15  static PRStatus OpenDevRandom( void )
16  {
17 -    fdDevRandom = open( "/dev/random", O_RDONLY );
18 +    fdDevRandom = open( "/dev/urandom", O_RDONLY );
19      return((-1 == fdDevRandom)? PR_FAILURE : PR_SUCCESS );
20  } /* end OpenDevRandom() */
21  
22  static size_t GetDevRandom( void *buf, size_t size )
23  {
24      int bytesIn;
25      int rc;
26