diff options
author | Stephen Wilson <wilsons@start.ca> | 2011-03-30 00:12:40 +0000 |
---|---|---|
committer | Stephen Wilson <wilsons@start.ca> | 2011-03-30 00:12:40 +0000 |
commit | dc91686f48e14bb4166858ceb6e0e0fab61111b4 (patch) | |
tree | 833e20415e15d639347998cd96b8b1cb4bad784e /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | |
parent | 4d7612744f080d2c0a8639c1f5e41b691e1bba55 (diff) | |
download | bcm5719-llvm-dc91686f48e14bb4166858ceb6e0e0fab61111b4.tar.gz bcm5719-llvm-dc91686f48e14bb4166858ceb6e0e0fab61111b4.zip |
Unfortunately, sranddev() is not available on all platforms so seed using the
current time instead.
llvm-svn: 128514
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index b434853120e..987f24637d2 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/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 @@ get_random_port () { if (!rand_initialized) { + time_t seed = time(NULL); + rand_initialized = true; - sranddev(); + srand(seed); } return (rand() % (UINT16_MAX - 1000u)) + 1000u; } |