summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Instance.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-04-23 12:02:26 +0000
committerMarc Laukien <marc@zeroc.com>2002-04-23 12:02:26 +0000
commitcb3cca50234f415321f7228b650a6522ca515c08 (patch)
tree14a2567b32fa7c93fbd2b73db11330596eeb316e /cpp/src/Ice/Instance.cpp
parentWIN32 updates. (diff)
downloadice-cb3cca50234f415321f7228b650a6522ca515c08.tar.bz2
ice-cb3cca50234f415321f7228b650a6522ca515c08.tar.xz
ice-cb3cca50234f415321f7228b650a6522ca515c08.zip
Time changes
Diffstat (limited to 'cpp/src/Ice/Instance.cpp')
-rw-r--r--cpp/src/Ice/Instance.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index 8cf81eb08e7..6e534c3f9f7 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -33,11 +33,8 @@
#ifndef _WIN32
# include <csignal>
# include <syslog.h>
-# include <sys/time.h>
# include <pwd.h>
# include <sys/types.h>
-#else
-# include <sys/timeb.h>
#endif
using namespace std;
@@ -220,6 +217,8 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Prope
if (_globalStateCounter == 1) // Only on first call
{
+ srand(static_cast<timeval>(IceUtil::Time::now()).tv_usec);
+
#ifdef _WIN32
WORD version = MAKEWORD(1, 1);
WSADATA data;
@@ -238,19 +237,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Prope
sigemptyset(&action.sa_mask);
action.sa_flags = 0;
sigaction(SIGPIPE, &action, 0);
-#endif
-
-#ifdef _WIN32
- struct _timeb tb;
- _ftime(&tb);
- srand(tb.millitm);
-#else
- timeval tv;
- gettimeofday(&tv, 0);
- srand(tv.tv_usec);
-#endif
-
-#ifndef _WIN32
+
string newUser = _properties->getProperty("Ice.ChangeUser");
if (!newUser.empty())
{