[Lldb-commits] [lldb] r128514 - /lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Stephen Wilson wilsons at start.ca
Tue Mar 29 17:12:40 PDT 2011


Author: wilsons
Date: Tue Mar 29 19:12:40 2011
New Revision: 128514

URL: http://llvm.org/viewvc/llvm-project?rev=128514&view=rev
Log:
Unfortunately, sranddev() is not available on all platforms so seed using the
current time instead.


Modified:
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=128514&r1=128513&r2=128514&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Tue Mar 29 19:12:40 2011
@@ -13,6 +13,7 @@
 #include <stdlib.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <time.h>
 
 // C++ Includes
 #include <algorithm>
@@ -61,8 +62,10 @@
 {
     if (!rand_initialized)
     {
+        time_t seed = time(NULL);
+
         rand_initialized = true;
-        sranddev();
+        srand(seed);
     }
     return (rand() % (UINT16_MAX - 1000u)) + 1000u;
 }





More information about the lldb-commits mailing list