summaryrefslogtreecommitdiff
path: root/ace/UNIX_Addr.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1997-11-07 07:37:25 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1997-11-07 07:37:25 +0000
commit0498db8d2d9ea110f43ca97a7abbc8b4de9e5137 (patch)
treeccdfa1209f9f9fde5a031792ad96667e2e339e05 /ace/UNIX_Addr.cpp
parent810043a4f95238d77da1e90529d96b4713890f1d (diff)
downloadATCD-0498db8d2d9ea110f43ca97a7abbc8b4de9e5137.tar.gz
*** empty log message ***
Diffstat (limited to 'ace/UNIX_Addr.cpp')
-rw-r--r--ace/UNIX_Addr.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/ace/UNIX_Addr.cpp b/ace/UNIX_Addr.cpp
index 5ce54752cf8..0b3df7354d3 100644
--- a/ace/UNIX_Addr.cpp
+++ b/ace/UNIX_Addr.cpp
@@ -34,21 +34,23 @@ ACE_UNIX_Addr::dump (void) const
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_);
+ (void) ACE_OS::memset ((void *) &this->unix_addr_,
+ 0,
+ sizeof this->unix_addr_);
}
int
ACE_UNIX_Addr::set (const ACE_UNIX_Addr &sa)
{
- size_t size = sa.get_size ();
-
- // Add one extra byte to account for the NUL at the end of the
- // pathname.
- if (size < sizeof this->unix_addr_)
- size = sa.get_size () + 1;
-
- this->unix_addr_.sun_family = AF_UNIX;
- ACE_OS::strcpy (this->unix_addr_.sun_path, sa.unix_addr_.sun_path);
+ this->base_set (sa.get_type (), sa.get_size ());
+
+ if (sa.get_type () == AF_ANY)
+ (void) ACE_OS::memset ((void *) &this->unix_addr_,
+ 0,
+ sizeof this->unix_addr_);
+ else
+ ACE_OS::strcpy (this->unix_addr_.sun_path,
+ sa.unix_addr_.sun_path);
return 0;
}
@@ -93,7 +95,7 @@ ACE_UNIX_Addr::set (const char rendezvous_point[])
this->ACE_Addr::base_set (AF_UNIX,
sizeof this->unix_addr_ -
sizeof (this->unix_addr_.sun_path) +
- ACE_OS::strlen (this->unix_addr_.sun_path) );
+ ACE_OS::strlen (this->unix_addr_.sun_path));
return 0;
}