summaryrefslogtreecommitdiff
path: root/tests/SOCK_Connector_Test.cpp
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-07-02 17:10:05 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-07-02 17:10:05 +0000
commit77bf0e71c866679ff35c61fe694894abc9eab4a8 (patch)
tree5a6a27c47b59a116f64353b16ad98cfbde615ae6 /tests/SOCK_Connector_Test.cpp
parent2bc56033eb3961c2b81df1cec7a95301f8bf8306 (diff)
downloadATCD-77bf0e71c866679ff35c61fe694894abc9eab4a8.tar.gz
(succeed_nonblocking): if the connection completion fails, save the errno
before doing the printout.
Diffstat (limited to 'tests/SOCK_Connector_Test.cpp')
-rw-r--r--tests/SOCK_Connector_Test.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/tests/SOCK_Connector_Test.cpp b/tests/SOCK_Connector_Test.cpp
index 31aef15ad25..b145a59b246 100644
--- a/tests/SOCK_Connector_Test.cpp
+++ b/tests/SOCK_Connector_Test.cpp
@@ -154,7 +154,7 @@ succeed_nonblocking (void)
if (status == 0 || (status == -1 && errno != EWOULDBLOCK))
{
ACE_DEBUG((LM_DEBUG,
- ASYS_TEXT ("Immediate success/fail; test not completed\n")));
+ ASYS_TEXT ("Immediate success/fail; test not completed\n")));
status = 0;
}
else
@@ -163,15 +163,19 @@ succeed_nonblocking (void)
status = con.complete (sock);
if (status == -1)
- {
- ACE_DEBUG ((LM_DEBUG, ASYS_TEXT("%p\n"),
- ASYS_TEXT("connect:complete")));
- if (errno == ECONNREFUSED || errno == ENOTCONN)
- status = 0;
- }
+ {
+ // In cast the errno gets overwritten by the printout. It
+ // does on LynxOS 2.5.0.
+ const int saved_errno = errno;
+
+ ACE_DEBUG ((LM_DEBUG, ASYS_TEXT("%p\n"),
+ ASYS_TEXT("connect:complete")));
+ if (saved_errno == ECONNREFUSED || errno == ENOTCONN)
+ status = 0;
+ }
else
- ACE_DEBUG((LM_DEBUG,
- ASYS_TEXT("Connect which should succeed, did\n")));
+ ACE_DEBUG((LM_DEBUG,
+ ASYS_TEXT("Connect which should succeed, did\n")));
}
// Just in case.