summaryrefslogtreecommitdiff
path: root/ace/Connector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ace/Connector.cpp')
-rw-r--r--ace/Connector.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/ace/Connector.cpp b/ace/Connector.cpp
index 9761a204c1e..a0e12e99768 100644
--- a/ace/Connector.cpp
+++ b/ace/Connector.cpp
@@ -457,11 +457,14 @@ ACE_Connector<SH, PR_CO_2>::connect_i (SH *&sh,
}
else
{
- // Save/restore errno.
- ACE_Errno_Guard error (errno);
+ // Make sure to save/restore the errno since <close> may
+ // change it.
+
+ int error = errno;
// Make sure to close down the Channel to avoid descriptor
// leaks.
new_sh->close (0);
+ errno = error;
}
return -1;
}
@@ -532,8 +535,7 @@ template <class SH, PR_CO_1> int
ACE_Connector<SH, PR_CO_2>::create_AST (SH *sh,
const ACE_Synch_Options &synch_options)
{
- // Save/restore errno.
- ACE_Errno_Guard error (errno);
+ int error = errno;
ACE_TRACE ("ACE_Connector<SH, PR_CO_2>::create_AST");
AST *ast;
@@ -567,10 +569,18 @@ ACE_Connector<SH, PR_CO_2>::create_AST (SH *sh,
goto fail3;
ast->cancellation_id (cancellation_id);
+ // Reset this because something might have gone wrong
+ // elsewhere...
+ errno = error;
return 0;
}
else
- return 0; // Ok, everything worked just fine...
+ {
+ // Reset this because something might have gone wrong
+ // elsewhere...
+ errno = error; // EWOULDBLOCK
+ return 0; // Ok, everything worked just fine...
+ }
}
// Undo previous actions using the ol' "goto label and fallthru"