[svn-r5060]

Purpose:
    Bugfix
Description:
    Internally created socket wasn't closed
Solution:
    In my last commit I only fixed the case for sending data over a socket.
    There was also a resource leak for the receiving side where an internally
    created socket wasn't closed. Same wrong logical condition, same fix.
Platforms tested:
    Linux, SGI
This commit is contained in:
Thomas Radke 2002-03-11 10:32:37 -05:00
parent 6eea626ef0
commit bbc50c3a1f

View File

@ -519,7 +519,7 @@ H5FDstream_open_socket (const char *filename, int o_flags,
/* Return if opening the socket failed */
if (*errormsg)
{
if (H5FD_STREAM_ERROR_CHECK (sock))
if (! H5FD_STREAM_ERROR_CHECK (sock))
{
H5FD_STREAM_CLOSE_SOCKET (sock);
sock = H5FD_STREAM_INVALID_SOCKET;
@ -756,7 +756,7 @@ static H5FD_t *H5FD_stream_open (const char *filename,
the opened socket is not needed anymore */
if (errormsg == NULL)
{
if (_stream.internal_socket && H5FD_STREAM_ERROR_CHECK (_stream.socket))
if (_stream.internal_socket && ! H5FD_STREAM_ERROR_CHECK (_stream.socket))
{
H5FD_STREAM_CLOSE_SOCKET (_stream.socket);
}
@ -786,7 +786,7 @@ static H5FD_t *H5FD_stream_open (const char *filename,
{
H5MM_xfree (_stream.mem);
}
if (_stream.internal_socket && H5FD_STREAM_ERROR_CHECK (_stream.socket))
if (_stream.internal_socket && ! H5FD_STREAM_ERROR_CHECK (_stream.socket))
{
H5FD_STREAM_CLOSE_SOCKET (_stream.socket);
}