From 62155adc2048916f7bd804ef1d57763e4d6c7dea Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Thu, 23 Mar 2006 21:01:38 +0000 Subject: Fixes --- cpp/src/IceUtil/Random.cpp | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'cpp/src/IceUtil/Random.cpp') 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; } // -- cgit v1.2.3