summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2003-04-09 16:37:37 +0000
committerMarc Laukien <marc@zeroc.com>2003-04-09 16:37:37 +0000
commita8bd4340198433bc239495b91aa7f6080e0f5b46 (patch)
tree8a4c7c5369561caa4913bad15024804c3a97c4a6 /cpp/src
parentGlacier request queue (diff)
downloadice-a8bd4340198433bc239495b91aa7f6080e0f5b46.tar.bz2
ice-a8bd4340198433bc239495b91aa7f6080e0f5b46.tar.xz
ice-a8bd4340198433bc239495b91aa7f6080e0f5b46.zip
fixes for RH9
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/Connection.cpp13
-rw-r--r--cpp/src/Ice/Network.cpp12
-rw-r--r--cpp/src/IceUtil/Cond.cpp18
-rw-r--r--cpp/src/IceUtil/RecMutex.cpp17
4 files changed, 54 insertions, 6 deletions
diff --git a/cpp/src/Ice/Connection.cpp b/cpp/src/Ice/Connection.cpp
index c26a7258c03..4f88a116b28 100644
--- a/cpp/src/Ice/Connection.cpp
+++ b/cpp/src/Ice/Connection.cpp
@@ -105,10 +105,17 @@ IceInternal::Connection::waitUntilFinished()
while(_transceiver || _dispatchCount > 0)
{
- if(timedWait(IceUtil::Time::milliSeconds(_endpoint->timeout())))
+ if(_endpoint->timeout() >= 0)
{
- setState(StateClosed, CloseTimeoutException(__FILE__, __LINE__));
- // No return here, we must still wait until _transceiver becomes null.
+ if(!timedWait(IceUtil::Time::milliSeconds(_endpoint->timeout())))
+ {
+ setState(StateClosed, CloseTimeoutException(__FILE__, __LINE__));
+ // No return here, we must still wait until _transceiver becomes null.
+ }
+ }
+ else
+ {
+ wait();
}
}
diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp
index 8809debefba..1f838c8de96 100644
--- a/cpp/src/Ice/Network.cpp
+++ b/cpp/src/Ice/Network.cpp
@@ -627,7 +627,11 @@ IceInternal::getAddress(const string& host, int port, struct sockaddr_in& addr)
if(!entry)
{
DNSException ex(__FILE__, __LINE__);
- ex.error = getDNSErrno();
+#ifdef _WIN32
+ ex.error = WSAGetLastError();
+#else
+ ex.error = h_errno;
+#endif
ex.host = host;
throw ex;
}
@@ -666,7 +670,11 @@ IceInternal::getLocalHost(bool numeric)
if(!entry)
{
DNSException ex(__FILE__, __LINE__);
- ex.error = getDNSErrno();
+#ifdef _WIN32
+ ex.error = WSAGetLastError();
+#else
+ ex.error = h_errno;
+#endif
ex.host = host;
throw ex;
}
diff --git a/cpp/src/IceUtil/Cond.cpp b/cpp/src/IceUtil/Cond.cpp
index 24ab3bd414d..29b76783186 100644
--- a/cpp/src/IceUtil/Cond.cpp
+++ b/cpp/src/IceUtil/Cond.cpp
@@ -200,7 +200,23 @@ IceUtil::Cond::timedDowait(const Time& timeout) const
IceUtil::Cond::Cond()
{
- int rc = pthread_cond_init(&_cond, 0);
+ int rc;
+
+ pthread_condattr_t attr;
+
+ rc = pthread_condattr_init(&attr);
+ if(rc != 0)
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__);
+ }
+
+ rc = pthread_cond_init(&_cond, &attr);
+ if(rc != 0)
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__);
+ }
+
+ rc = pthread_condattr_destroy(&attr);
if(rc != 0)
{
throw ThreadSyscallException(__FILE__, __LINE__);
diff --git a/cpp/src/IceUtil/RecMutex.cpp b/cpp/src/IceUtil/RecMutex.cpp
index d20486c3a34..a6e75363afe 100644
--- a/cpp/src/IceUtil/RecMutex.cpp
+++ b/cpp/src/IceUtil/RecMutex.cpp
@@ -91,7 +91,9 @@ IceUtil::RecMutex::RecMutex() :
int rc;
#if _POSIX_VERSION >= 199506L
+
pthread_mutexattr_t attr;
+
rc = pthread_mutexattr_init(&attr);
if(rc != 0)
{
@@ -103,10 +105,15 @@ IceUtil::RecMutex::RecMutex() :
{
throw ThreadSyscallException(__FILE__, __LINE__);
}
+
#elif defined(__linux__)
+
const pthread_mutexattr_t attr = { PTHREAD_MUTEX_RECURSIVE_NP };
+
#else
+
const pthread_mutexattr_t attr = { PTHREAD_MUTEX_RECURSIVE };
+
#endif
rc = pthread_mutex_init(&_mutex, &attr);
@@ -114,6 +121,16 @@ IceUtil::RecMutex::RecMutex() :
{
throw ThreadSyscallException(__FILE__, __LINE__);
}
+
+#if _POSIX_VERSION >= 199506L
+
+ rc = pthread_mutexattr_destroy(&attr);
+ if(rc != 0)
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__);
+ }
+
+#endif
}
IceUtil::RecMutex::~RecMutex()