diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-12-23 13:31:51 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-12-23 13:31:51 +0000 |
commit | 9df86a265cffd2d292f307477126779bf7cb3b92 (patch) | |
tree | ae1e777c54c07bffbf75e08b8a53c16c5a9441e1 /ace/TLI_Stream.cpp | |
parent | a067be5d9ca214eda7528a69a81518b3454d8378 (diff) | |
download | ATCD-9df86a265cffd2d292f307477126779bf7cb3b92.tar.gz |
(get_remote_addr): use ACE_NOTSUP_RETURN if ! ACE_HAS_SVR4_TLI. Declare and set local "name" only if ACE_HAS_SVR4_TLI.
Diffstat (limited to 'ace/TLI_Stream.cpp')
-rw-r--r-- | ace/TLI_Stream.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/ace/TLI_Stream.cpp b/ace/TLI_Stream.cpp index ed32039f151..bc9b1c3b7c5 100644 --- a/ace/TLI_Stream.cpp +++ b/ace/TLI_Stream.cpp @@ -1,8 +1,7 @@ -// TLI_Stream.cpp // $Id$ /* Defines the member functions for the base class of the ACE_TLI_Stream - abstraction. */ + abstraction. */ #define ACE_BUILD_DLL #include "ace/TLI_Stream.h" @@ -26,26 +25,25 @@ int ACE_TLI_Stream::get_remote_addr (ACE_Addr &sa) const { ACE_TRACE ("ACE_TLI_Stream::get_remote_addr"); - struct netbuf name; +#if defined (ACE_HAS_SVR4_TLI) + struct netbuf name; name.maxlen = sa.get_size (); name.buf = (char *) sa.get_addr (); - -#if defined (ACE_HAS_SVR4_TLI) - if (ACE_OS::ioctl (this->get_handle (), TI_GETPEERNAME, &name) == -1) -/* if (ACE_OS::t_getname (this->get_handle (), &name, REMOTENAME) == -1) */ -#else /* SunOS4 sucks... */ - if (0) -#endif /* ACE_HAS_SVR4_TLI */ + if (ACE_OS::ioctl (this->get_handle (), TI_GETPEERNAME, &name) == -1) +/* if (ACE_OS::t_getname (this->get_handle (), &name, REMOTENAME) == -1) */ return -1; else return 0; +#else /* SunOS4 sucks... */ + ACE_NOTSUP_RETURN (-1); +#endif /* ACE_HAS_SVR4_TLI */ } /* Send a release and then await the release from the other side */ -int +int ACE_TLI_Stream::active_close (void) { ACE_TRACE ("ACE_TLI_Stream::active_close"); @@ -56,12 +54,12 @@ ACE_TLI_Stream::active_close (void) if (this->recv (&buf, sizeof buf) == ACE_INVALID_HANDLE) { if (t_errno == TLOOK && this->look () == T_ORDREL) - { - if (this->rcvrel () == ACE_INVALID_HANDLE) - return ACE_INVALID_HANDLE; - } + { + if (this->rcvrel () == ACE_INVALID_HANDLE) + return ACE_INVALID_HANDLE; + } else - return ACE_INVALID_HANDLE; + return ACE_INVALID_HANDLE; } return this->close (); } @@ -69,7 +67,7 @@ ACE_TLI_Stream::active_close (void) /* Acknowledge the release from the other side and then send the release to the other side. */ -int +int ACE_TLI_Stream::passive_close (void) { ACE_TRACE ("ACE_TLI_Stream::passive_close"); |