diff options
author | Steve Huston <shuston@riverace.com> | 1997-07-17 21:17:40 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 1997-07-17 21:17:40 +0000 |
commit | eff67fe6fc2e7b62626212de16b5f4a545dca230 (patch) | |
tree | 417d3e6963802b86c36baa92385dc32845fe7c71 /ace/SOCK_Connector.cpp | |
parent | 3464d508b092a407018241213b8545c75797021a (diff) | |
download | ATCD-eff67fe6fc2e7b62626212de16b5f4a545dca230.tar.gz |
If a connect fails, save the errno value before closing the socket, else
the error may be overwritten.
Diffstat (limited to 'ace/SOCK_Connector.cpp')
-rw-r--r-- | ace/SOCK_Connector.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ace/SOCK_Connector.cpp b/ace/SOCK_Connector.cpp index c02b45759c2..af918c06ed1 100644 --- a/ace/SOCK_Connector.cpp +++ b/ace/SOCK_Connector.cpp @@ -98,8 +98,10 @@ ACE_SOCK_Connector::connect (ACE_SOCK_Stream &new_stream, else if (!(errno == EWOULDBLOCK || errno == ETIMEDOUT)) { // If things have gone wrong, close down and return an error. + int saved_errno = errno; this->close (); new_stream.set_handle (ACE_INVALID_HANDLE); + errno = saved_errno; } return result; } |