summaryrefslogtreecommitdiff
path: root/ace/INET_Addr.cpp
diff options
context:
space:
mode:
authorChris Cleeland <chris.cleeland@gmail.com>2003-11-14 21:27:54 +0000
committerChris Cleeland <chris.cleeland@gmail.com>2003-11-14 21:27:54 +0000
commit9293a56b8a291050e92690c5f7b76f34ab94b87d (patch)
tree8669fa5e411837130fd02cb5712b142f9de4bd40 /ace/INET_Addr.cpp
parentb33ec937d584ddef39dc7ca891c5510a21682d83 (diff)
downloadATCD-9293a56b8a291050e92690c5f7b76f34ab94b87d.tar.gz
Fri Nov 14 15:17:30 2003 Chris Cleeland <cleeland_c@ociweb.com>
Diffstat (limited to 'ace/INET_Addr.cpp')
-rw-r--r--ace/INET_Addr.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/ace/INET_Addr.cpp b/ace/INET_Addr.cpp
index cdcd6efff9e..997594624ad 100644
--- a/ace/INET_Addr.cpp
+++ b/ace/INET_Addr.cpp
@@ -941,6 +941,7 @@ ACE_INET_Addr::get_host_addr (char *dst, int size) const
// So, we use the way that vxworks suggests.
ACE_INET_Addr *ncthis = ACE_const_cast (ACE_INET_Addr *, this);
inet_ntoa_b (this->inet_addr_.in4_.sin_addr, ncthis->buf_);
+ ACE_OS::strsncpy (dst, &buf_[0], size);
return &buf_[0];
#else /* VXWORKS */
char *ch = ACE_OS::inet_ntoa (this->inet_addr_.in4_.sin_addr);
@@ -958,7 +959,18 @@ ACE_INET_Addr::get_host_addr (void) const
static char buf[INET6_ADDRSTRLEN];
return this->get_host_addr (buf, INET6_ADDRSTRLEN);
#else
+# if defined (VXWORKS)
+ // It would be nice to be able to encapsulate this into
+ // ACE_OS::inet_ntoa(), but that would lead to either inefficiencies
+ // on vxworks or lack of thread safety.
+ //
+ // So, we use the way that vxworks suggests.
+ ACE_INET_Addr *ncthis = ACE_const_cast (ACE_INET_Addr *, this);
+ inet_ntoa_b (this->inet_addr_.in4_.sin_addr, ncthis->buf_);
+ return &buf_[0];
+# else /* VXWORKS */
return ACE_OS::inet_ntoa (this->inet_addr_.in4_.sin_addr);
+# endif /* !VXWORKS */
#endif
}