diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-03-23 21:01:38 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-03-23 21:01:38 +0000 |
commit | 62155adc2048916f7bd804ef1d57763e4d6c7dea (patch) | |
tree | b637442ff5211ef6b1988054f04201eb18c517b0 /cpp/src/IceUtil/Random.cpp | |
parent | Fixed bug in AMI wrt use of range type (diff) | |
download | ice-62155adc2048916f7bd804ef1d57763e4d6c7dea.tar.bz2 ice-62155adc2048916f7bd804ef1d57763e4d6c7dea.tar.xz ice-62155adc2048916f7bd804ef1d57763e4d6c7dea.zip |
Fixes
Diffstat (limited to 'cpp/src/IceUtil/Random.cpp')
-rw-r--r-- | cpp/src/IceUtil/Random.cpp | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/cpp/src/IceUtil/Random.cpp b/cpp/src/IceUtil/Random.cpp index ff6f89b254b..52d4c3ead3b 100644 --- a/cpp/src/IceUtil/Random.cpp +++ b/cpp/src/IceUtil/Random.cpp @@ -36,13 +36,10 @@ const char* IceUtil::RandomGeneratorException::_name = "IceUtil::RandomGenerator // linux-kernel mailing list archive for additional details. // Since /dev/urandom on other platforms is usually a port from Linux, this problem // could be widespread. Therefore, we serialize access to /dev/urandom using a static -// mutex. We also cache the process id for convenience (needed by generateUUID() to -// make sure 2 different processes can't return the same UUID because of this problem, -// see UUID.cpp). +// mutex. // static IceUtil::StaticMutex staticMutex = ICE_STATIC_MUTEX_INITIALIZER; static int fd = -1; -static char myPid[2]; namespace { @@ -88,26 +85,6 @@ IceUtil::RandomGeneratorException::ice_throw() const throw *this; } -// -// Used by generateUUID() to get a random sequence and the pid of -// current process. -// -#ifndef _WIN32 -namespace IceUtil -{ - -void -generateRandomAndGetPid(char* buffer, int size, char* pid) -{ - assert(pid); - generateRandom(buffer, size); - pid[0] = myPid[0]; - pid[1] = myPid[1]; -} - -} -#endif - void IceUtil::generateRandom(char* buffer, int size) { @@ -132,13 +109,6 @@ IceUtil::generateRandom(char* buffer, int size) assert(0); throw RandomGeneratorException(__FILE__, __LINE__); } - - // - // Initialize myPid as well - // - pid_t p = getpid(); - myPid[0] = (p >> 8) & 0x7F; - myPid[1] = p & 0xFF; } // |