summaryrefslogtreecommitdiff
path: root/ace/UNIX_Addr.cpp
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>1999-05-27 21:08:26 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>1999-05-27 21:08:26 +0000
commitfb1c661d51c7d3f14c75dcc9933d8e9a7323826e (patch)
treed9cdbe5bc6a522c144249c85e62c9bbfa036d261 /ace/UNIX_Addr.cpp
parent1ad8cf18c2e2f04c3d372e3d808ac0efc559c028 (diff)
downloadATCD-fb1c661d51c7d3f14c75dcc9933d8e9a7323826e.tar.gz
* ace/UNIX_Addr.cpp (set):
Explicitly set the sun_family to AF_UNIX, otherwise it will be zero by a previous call to memset(). AF_UNSPEC, which is zero, is what the call to memset() cause the sun_family to be.
Diffstat (limited to 'ace/UNIX_Addr.cpp')
-rw-r--r--ace/UNIX_Addr.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/ace/UNIX_Addr.cpp b/ace/UNIX_Addr.cpp
index 8f05c990f22..91bcaf945d3 100644
--- a/ace/UNIX_Addr.cpp
+++ b/ace/UNIX_Addr.cpp
@@ -34,19 +34,18 @@ ACE_UNIX_Addr::dump (void) const
// Do nothing constructor.
ACE_UNIX_Addr::ACE_UNIX_Addr (void)
- : ACE_Addr (AF_UNIX, sizeof this->unix_addr_)
{
(void) ACE_OS::memset ((void *) &this->unix_addr_,
0,
sizeof this->unix_addr_);
+
this->unix_addr_.sun_family = AF_UNIX;
+ this->base_set (AF_UNIX, sizeof this->unix_addr_);
}
int
ACE_UNIX_Addr::set (const ACE_UNIX_Addr &sa)
{
- this->base_set (sa.get_type (), sa.get_size ());
-
if (sa.get_type () == AF_ANY)
(void) ACE_OS::memset ((void *) &this->unix_addr_,
0,
@@ -54,6 +53,10 @@ ACE_UNIX_Addr::set (const ACE_UNIX_Addr &sa)
else
ACE_OS::strcpy (this->unix_addr_.sun_path,
sa.unix_addr_.sun_path);
+
+ this->unix_addr_.sun_family = AF_UNIX;
+ this->base_set (sa.get_type (), sa.get_size ());
+
return 0;
}