diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-11-17 21:38:31 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-11-17 21:38:31 +0000 |
commit | af49304b0d5b673df0c7cb5b08c8fe6ac81a1b8e (patch) | |
tree | 353adf7dd01a4061231ec276ebe278d00b1d1698 /ace/INET_Addr.cpp | |
parent | e1cb174df2af0ab8ea5560f6ae48da94bdf6ca8c (diff) | |
download | ATCD-af49304b0d5b673df0c7cb5b08c8fe6ac81a1b8e.tar.gz |
(get_host_name): on VxWorks only, moved hostGetByAddr code block
to _after_ the check for the address being INADDR_ANY.
Diffstat (limited to 'ace/INET_Addr.cpp')
-rw-r--r-- | ace/INET_Addr.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
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. |