commit | 60f19d51b4e161ac4f4ca2f3edc14867441a0bde | [log] [tgz] |
---|---|---|
author | Stephen Wilson <wilsons@start.ca> | Wed Mar 30 00:12:40 2011 +0000 |
committer | Stephen Wilson <wilsons@start.ca> | Wed Mar 30 00:12:40 2011 +0000 |
tree | a69047d52d210eba40d4bd792a0ad24d913084f1 | |
parent | 4cccd53eba9c0ab2b3a4cf4aca42a2669d8834f4 [diff] |
Unfortunately, sranddev() is not available on all platforms so seed using the current time instead. git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128514 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index b434853..987f246 100644 --- a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -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; }