From af49304b0d5b673df0c7cb5b08c8fe6ac81a1b8e Mon Sep 17 00:00:00 2001 From: levine Date: Mon, 17 Nov 1997 21:38:31 +0000 Subject: (get_host_name): on VxWorks only, moved hostGetByAddr code block to _after_ the check for the address being INADDR_ANY. --- ace/INET_Addr.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'ace/INET_Addr.cpp') diff --git a/ace/INET_Addr.cpp b/ace/INET_Addr.cpp index 74d66e138be..df6e9bb7757 100644 --- a/ace/INET_Addr.cpp +++ b/ace/INET_Addr.cpp @@ -356,18 +356,6 @@ ACE_INET_Addr::get_host_name (char hostname[], size_t len) const { ACE_TRACE ("ACE_INET_Addr::get_host_name"); -#if defined (VXWORKS) - ACE_UNUSED_ARG (len); - int error = ::hostGetByAddr ((int) this->inet_addr_.sin_addr.s_addr, - hostname); - if (error == OK) - return 0; - else - { - errno = error; - return -1; - } -#else if (this->inet_addr_.sin_addr.s_addr == INADDR_ANY) { if (ACE_OS::hostname (hostname, len) == -1) @@ -377,6 +365,18 @@ ACE_INET_Addr::get_host_name (char hostname[], size_t len) const } else { +#if defined (VXWORKS) + ACE_UNUSED_ARG (len); + int error = ::hostGetByAddr ((int) this->inet_addr_.sin_addr.s_addr, + hostname); + if (error == OK) + return 0; + else + { + errno = error; + return -1; + } +#else hostent hentry; int a_len = sizeof this->inet_addr_.sin_addr.s_addr; int error = 0; @@ -413,8 +413,8 @@ ACE_INET_Addr::get_host_name (char hostname[], size_t len) const return 0; } } - } #endif /* VXWORKS */ + } } // Return the character representation of the hostname. -- cgit v1.2.1