[Teleus-cvs] teleus/src/math random.cpp,1.3,1.4
Status: Inactive
Brought to you by:
spiffgq
|
From: <sp...@us...> - 2004-03-11 03:31:15
|
Update of /cvsroot/teleus/teleus/src/math In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8181/src/math Modified Files: random.cpp Log Message: Changed /dev/random to /dev/urandom. Index: random.cpp =================================================================== RCS file: /cvsroot/teleus/teleus/src/math/random.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** random.cpp 25 Feb 2004 06:34:00 -0000 1.3 --- random.cpp 11 Mar 2004 03:12:51 -0000 1.4 *************** *** 117,121 **** // Attempt to open /dev/random ! FILE *fp = fopen ("/dev/random", "r"); if (fp == NULL){ --- 117,121 ---- // Attempt to open /dev/random ! FILE *fp = fopen ("/dev/urandom", "r"); if (fp == NULL){ *************** *** 128,131 **** --- 128,133 ---- }else{ + + #if 1 // If we could open /dev/random, we'll read in four // bytes and convert that into an integer to use as *************** *** 140,143 **** --- 142,149 ---- fread (temp.buffer, 4, 1, fp); generatedSeed = temp.integer; + fclose(fp); + #else + assertNotReached(); + #endif } |