# HG changeset patch # User Matt Johnston # Date 1424782412 -28800 # Node ID d0e6dd5af46e00ea432d1b20336dd3ca3f0fc10e # Parent d3925ed45a852b3e4002a15c25bb7b7efa81779f Use m_close() which will avoid close(-1) diff -r d3925ed45a85 -r d0e6dd5af46e common-channel.c --- a/common-channel.c Tue Feb 24 20:51:18 2015 +0800 +++ b/common-channel.c Tue Feb 24 20:53:32 2015 +0800 @@ -586,11 +586,11 @@ /* close the FDs in case they haven't been done * yet (they might have been shutdown etc) */ TRACE(("CLOSE writefd %d", channel->writefd)) - close(channel->writefd); + m_close(channel->writefd); TRACE(("CLOSE readfd %d", channel->readfd)) - close(channel->readfd); + m_close(channel->readfd); TRACE(("CLOSE errfd %d", channel->errfd)) - close(channel->errfd); + m_close(channel->errfd); } if (!channel->close_handler_done @@ -1001,7 +1001,7 @@ } } else { TRACE(("CLOSE some fd %d", fd)) - close(fd); + m_close(fd); closein = closeout = 1; } @@ -1024,7 +1024,7 @@ if (channel->type->sepfds && channel->readfd == FD_CLOSED && channel->writefd == FD_CLOSED && channel->errfd == FD_CLOSED) { TRACE(("CLOSE (finally) of %d", fd)) - close(fd); + m_close(fd); } }