diff --git a/code/sys/sys_unix.c b/code/sys/sys_unix.c index 0cffd4f1..60050931 100644 --- a/code/sys/sys_unix.c +++ b/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 );