summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-09-26 20:19:46 +0000
committernw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-09-26 20:19:46 +0000
commit18beb4810892e6204f425273ba5032a735d3aa12 (patch)
treee8a286aa6a2edc05be8c1496d9b5c29cb50ddffb
parente8a5720d9043e8b43edde94cfa663c2329b59ac5 (diff)
downloadATCD-18beb4810892e6204f425273ba5032a735d3aa12.tar.gz
Moved checking for invalid handle from SOCK_Stream::close to
SOCK_Stream::close_writer and SOCK_Stream::close_reader.
-rw-r--r--ace/SOCK_Stream.cpp3
-rw-r--r--ace/SOCK_Stream.i10
2 files changed, 9 insertions, 4 deletions
diff --git a/ace/SOCK_Stream.cpp b/ace/SOCK_Stream.cpp
index 3abc14a54c4..2acb22f962c 100644
--- a/ace/SOCK_Stream.cpp
+++ b/ace/SOCK_Stream.cpp
@@ -22,8 +22,7 @@ ACE_SOCK_Stream::close (void)
// do this on UNIX since it doesn't have this "feature". Moreover,
// this will cause subtle problems on UNIX due to the way that
// fork() works.
- if (this->get_handle () != ACE_INVALID_HANDLE)
- this->close_writer ();
+ this->close_writer ();
#endif /* ACE_WIN32 */
// Close down the socket.
return ACE_SOCK::close ();
diff --git a/ace/SOCK_Stream.i b/ace/SOCK_Stream.i
index d916914da4a..93a35ad219d 100644
--- a/ace/SOCK_Stream.i
+++ b/ace/SOCK_Stream.i
@@ -11,7 +11,10 @@ inline int
ACE_SOCK_Stream::close_reader (void)
{
ACE_TRACE ("ACE_SOCK_Stream::close_reader");
- return ACE_OS::shutdown (this->get_handle (), 0);
+ if (this->get_handle () != ACE_INVALID_HANDLE)
+ return ACE_OS::shutdown (this->get_handle (), 0);
+ else
+ return 0;
}
// Shut down just the writing end of a ACE_SOCK.
@@ -20,7 +23,10 @@ inline int
ACE_SOCK_Stream::close_writer (void)
{
ACE_TRACE ("ACE_SOCK_Stream::close_writer");
- return ACE_OS::shutdown (this->get_handle (), 1);
+ if (this->get_handle () != ACE_INVALID_HANDLE)
+ return ACE_OS::shutdown (this->get_handle (), 1);
+ else
+ return 0;
}
inline ssize_t