summaryrefslogtreecommitdiff
path: root/ace/ACE.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ace/ACE.cpp')
-rw-r--r--ace/ACE.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/ace/ACE.cpp b/ace/ACE.cpp
index b5f7d325e98..5b96172d8e6 100644
--- a/ace/ACE.cpp
+++ b/ace/ACE.cpp
@@ -1222,14 +1222,16 @@ ACE::leave_recv_timedwait (ACE_HANDLE handle,
int val)
{
if (timeout != 0
- && ACE_BIT_DISABLED (val,
- ACE_NONBLOCK))
+ && ACE_BIT_DISABLED (val, ACE_NONBLOCK))
{
- // Save/restore errno.
- ACE_Errno_Guard error (errno);
+ // We need to stash errno here because ACE::clr_flags() may
+ // reset it.
+ int error = errno;
+
// Only disable ACE_NONBLOCK if we weren't in non-blocking mode
// originally.
ACE::clr_flags (handle, ACE_NONBLOCK);
+ errno = error;
}
}
@@ -1302,11 +1304,14 @@ ACE::leave_send_timedwait (ACE_HANDLE handle,
if (timeout != 0
&& ACE_BIT_DISABLED (val, ACE_NONBLOCK))
{
- // Save/restore errno.
- ACE_Errno_Guard error (errno);
+ // We need to stash errno here because ACE::clr_flags() may
+ // reset it.
+ int error = errno;
+
// Only disable ACE_NONBLOCK if we weren't in non-blocking mode
// originally.
ACE::clr_flags (handle, ACE_NONBLOCK);
+ errno = error;
}
}