[glib/glib-2-20] Read /dev/urandom unbuffered



commit 1674764f0c9bb458125b53124a4aff7b2acfe540
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Aug 27 22:59:05 2009 -0400

    Read /dev/urandom unbuffered
    
    To avoid wasting entropy. Bug 593232.

 glib/grand.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/glib/grand.c b/glib/grand.c
index 55f8970..8edcca3 100644
--- a/glib/grand.c
+++ b/glib/grand.c
@@ -181,6 +181,7 @@ g_rand_new (void)
 	{
 	  int r;
 
+	  setvbuf (dev_urandom, NULL, _IONBF, 0);
 	  do
 	    {
 	      errno = 0;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]