This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit 43e76dddc0ae93c7164016ce359a51306d6f6c08
Author: MAN-AT-ARMS <m4n4t4...@gmail.com>
Date:   Wed Sep 9 11:15:35 2015 -0400

    All: Ensure reads from /dev/urandom are unbuffered
---
 MP/code/sys/sys_unix.c | 2 ++
 SP/code/sys/sys_unix.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/MP/code/sys/sys_unix.c b/MP/code/sys/sys_unix.c
index e4bbc4a..62c95ee 100644
--- a/MP/code/sys/sys_unix.c
+++ b/MP/code/sys/sys_unix.c
@@ -123,6 +123,8 @@ qboolean Sys_RandomBytes( byte *string, int len )
        if( !fp )
                return qfalse;
 
+       setvbuf( fp, NULL, _IONBF, 0 ); // don't buffer reads from /dev/urandom
+
        if( fread( string, sizeof( byte ), len, fp ) != len )
        {
                fclose( fp );
diff --git a/SP/code/sys/sys_unix.c b/SP/code/sys/sys_unix.c
index 84dc1ef..02286dd 100644
--- a/SP/code/sys/sys_unix.c
+++ b/SP/code/sys/sys_unix.c
@@ -123,6 +123,8 @@ qboolean Sys_RandomBytes( byte *string, int len )
        if( !fp )
                return qfalse;
 
+       setvbuf( fp, NULL, _IONBF, 0 ); // don't buffer reads from /dev/urandom
+
        if( fread( string, sizeof( byte ), len, fp ) != len )
        {
                fclose( fp );

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-games/iortcw.git

_______________________________________________
Pkg-games-commits mailing list
Pkg-games-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

Reply via email to