summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-07-02 17:58:40 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-07-02 17:58:40 +0000
commite51247d70ea509672af45449721a8b0f467c82c7 (patch)
treeacfca573eb4b7e74c2c1a4855059b06e6403999f
parentd365829c658be59c15825bd4efd260caa7cfd19b (diff)
downloadATCD-e51247d70ea509672af45449721a8b0f467c82c7.tar.gz
no need for a temporary: reset status before printing out
-rw-r--r--tests/SOCK_Connector_Test.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/SOCK_Connector_Test.cpp b/tests/SOCK_Connector_Test.cpp
index b145a59b246..4f0b197ff45 100644
--- a/tests/SOCK_Connector_Test.cpp
+++ b/tests/SOCK_Connector_Test.cpp
@@ -164,14 +164,13 @@ succeed_nonblocking (void)
if (status == -1)
{
- // In cast the errno gets overwritten by the printout. It
- // does on LynxOS 2.5.0.
- const int saved_errno = errno;
+ // Reset the status _before_ doing the printout, in case the
+ // printout overwrites errno.
+ if (errno == ECONNREFUSED || errno == ENOTCONN)
+ status = 0;
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,