summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>2001-03-21 14:01:52 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>2001-03-21 14:01:52 +0000
commit99b73785597bc205573b353c5859c122c731c7b5 (patch)
tree70f2df0f6f94a6393e06ccc17631f21a26823ae6
parentb7ff7d2f3f86fc125f741cfe56a721e86e516993 (diff)
downloadATCD-99b73785597bc205573b353c5859c122c731c7b5.tar.gz
ChangeLogTag:Wed Mar 21 07:23:15 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu>
-rw-r--r--ChangeLog6
-rw-r--r--ChangeLogs/ChangeLog-02a6
-rw-r--r--ChangeLogs/ChangeLog-03a6
-rw-r--r--tests/SOCK_Connector_Test.cpp19
4 files changed, 28 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 9e9168e1a0b..8d94e79ecd1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Mar 21 07:23:15 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu>
+
+ * tests/SOCK_Connector_Test.cpp (find_another_host): Make the
+ test a bit more resilent against errors with gethostbyname().
+ Thanks to Lu Yunhai <luyunhai@huawei.com> for this fix.
+
Tue Mar 20 17:31:21 2001 Carlos O'Ryan <coryan@uci.edu>
* tests/run_test.lst:
diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a
index 9e9168e1a0b..8d94e79ecd1 100644
--- a/ChangeLogs/ChangeLog-02a
+++ b/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,9 @@
+Wed Mar 21 07:23:15 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu>
+
+ * tests/SOCK_Connector_Test.cpp (find_another_host): Make the
+ test a bit more resilent against errors with gethostbyname().
+ Thanks to Lu Yunhai <luyunhai@huawei.com> for this fix.
+
Tue Mar 20 17:31:21 2001 Carlos O'Ryan <coryan@uci.edu>
* tests/run_test.lst:
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index 9e9168e1a0b..8d94e79ecd1 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,3 +1,9 @@
+Wed Mar 21 07:23:15 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu>
+
+ * tests/SOCK_Connector_Test.cpp (find_another_host): Make the
+ test a bit more resilent against errors with gethostbyname().
+ Thanks to Lu Yunhai <luyunhai@huawei.com> for this fix.
+
Tue Mar 20 17:31:21 2001 Carlos O'Ryan <coryan@uci.edu>
* tests/run_test.lst:
diff --git a/tests/SOCK_Connector_Test.cpp b/tests/SOCK_Connector_Test.cpp
index 945b3935033..baf3037e163 100644
--- a/tests/SOCK_Connector_Test.cpp
+++ b/tests/SOCK_Connector_Test.cpp
@@ -86,8 +86,11 @@ find_another_host (ACE_TCHAR other_host[])
h = ACE_OS::gethostbyname (un.nodename);
- // Use me if can't find another
- ACE_OS::strcpy (other_host, ACE_TEXT_CHAR_TO_TCHAR (h->h_name));
+ if (h == 0)
+ ACE_OS::strcpy (other_host, ACE_LOCALHOST);
+ else
+ // Use me if can't find another
+ ACE_OS::strcpy (other_host, ACE_TEXT_CHAR_TO_TCHAR (h->h_name));
// @@ We really need to add wrappers for these hostent methods.
@@ -126,13 +129,11 @@ find_another_host (ACE_TCHAR other_host[])
// Now try to connect to candidates
for (int i = 0; i < candidate_count; i++)
- {
- if (host_is_up (candidate[i].host_name))
- {
- ACE_OS::strcpy (other_host, candidate[i].host_name);
- break;
- }
- }
+ if (host_is_up (candidate[i].host_name))
+ {
+ ACE_OS::strcpy (other_host, candidate[i].host_name);
+ break;
+ }
endhostent ();
#endif /* ! ACE_LACKS_GETHOSTENT */