summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/LocalException.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/LocalException.cpp')
-rw-r--r--cpp/src/Ice/LocalException.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/cpp/src/Ice/LocalException.cpp b/cpp/src/Ice/LocalException.cpp
index 2a63fa5f75a..b8e2b1a62c8 100644
--- a/cpp/src/Ice/LocalException.cpp
+++ b/cpp/src/Ice/LocalException.cpp
@@ -513,7 +513,7 @@ Ice::SystemException::SystemException(const char* file, int line) :
LocalException(file, line)
{
#ifdef WIN32
- _error = WSAGetLastError();
+ _error = GetLastError();
#else
_error = errno;
#endif
@@ -559,6 +559,13 @@ Ice::SystemException::raise() const
Ice::SocketException::SocketException(const char* file, int line) :
SystemException(file, line)
{
+#ifdef WIN32
+ //
+ // Overwrite _error, which has been set by GetLastError() in the
+ // SystemException constructor, with WSAGetLastError()
+ //
+ _error = WSAGetLastError();
+#endif
}
Ice::SocketException::SocketException(const SocketException& ex) :