summaryrefslogtreecommitdiff
path: root/ace/Connector.cpp
diff options
context:
space:
mode:
authornobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-06-16 18:17:52 +0000
committernobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-06-16 18:17:52 +0000
commitb507b0691a35ea9b7192e65ea0e435847ce4fd1d (patch)
tree09ed4da2c283288cb50b892d6b428fe74cce5b5f /ace/Connector.cpp
parentb2e62a6ef510b4560a3b9f0d69de1f3df4da4d3e (diff)
downloadATCD-ami_phase2_end.tar.gz
This commit was manufactured by cvs2svn to create tagami_phase2_end
'ami_phase2_end'.
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"