Author: sayer
Date: 2010-02-23 16:24:59 +0100 (Tue, 23 Feb 2010)
New Revision: 1628

Modified:
   trunk/core/AmUtils.cpp
Log:
warn if rng could not be initialized (and make compiler happy)

Modified: trunk/core/AmUtils.cpp
===================================================================
--- trunk/core/AmUtils.cpp      2010-02-23 15:24:05 UTC (rev 1627)
+++ trunk/core/AmUtils.cpp      2010-02-23 15:24:59 UTC (rev 1628)
@@ -957,7 +957,9 @@
   int seed=0;
   FILE* fp_rand = fopen("/dev/urandom","r");
   if(fp_rand){
-    fread(&seed,sizeof(int),1,fp_rand);
+    if (fread(&seed,sizeof(int),1,fp_rand) != 1) {
+      DBG("/dev/urandom could not be read, rng probably not initialized.\n");
+    }
     fclose(fp_rand);
   }
   seed += getpid();

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to