diff options
Diffstat (limited to 'orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.cpp')
-rw-r--r-- | orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.cpp b/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.cpp index 20ff2119ba2..0a67dc6a12d 100644 --- a/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.cpp +++ b/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.cpp @@ -1,13 +1,15 @@ //$Id$ + #include "orbsvcs/FtRtEvent/Utils/UUID.h" -ACE_RCSID (Utils, - UUID, - "$Id$") #if !defined(__ACE_INLINE__) #include "orbsvcs/FtRtEvent/Utils/UUID.inl" #endif /* __ACE_INLINE__ */ +#include "ace/OS_NS_unistd.h" +#include "ace/OS_NS_netdb.h" +#include "ace/OS_NS_sys_time.h" + TAO_BEGIN_VERSIONED_NAMESPACE_DECL namespace TAO_FtRt { @@ -117,7 +119,7 @@ UUID::to_string (char *string_rep) const void UUID::create (unsigned char *buffer) { - static ACE_RANDR_TYPE seed; + static unsigned int seed; if (seed == 0) seed = ACE_OS::getpid(); @@ -127,8 +129,8 @@ UUID::create (unsigned char *buffer) // initialize the node if (ACE_OS::getmacaddress(&node.mac_address) == -1) { - node.rand_node.rand1 = ACE_OS::rand_r(seed); - node.rand_node.rand2 = (unsigned short) ACE_OS::rand_r(seed); + node.rand_node.rand1 = ACE_OS::rand_r(&seed); + node.rand_node.rand2 = (unsigned short) ACE_OS::rand_r(&seed); } } @@ -158,7 +160,7 @@ UUID::create (unsigned char *buffer) buffer[7] = (unsigned char) (((timestamp >> 56) & 0x0f) + 0x10); ACE_UINT16 clockSequence = static_cast< - ACE_UINT16> (ACE_OS::rand_r(seed) & 0x2ff); + ACE_UINT16> (ACE_OS::rand_r(&seed) & 0x2ff); buffer[8] = (unsigned char) ((clockSequence >> 8) & 0x1f); buffer[9] = (unsigned char) (clockSequence & 0x1f); |