changeset 1039:d0e6dd5af46e

Use m_close() which will avoid close(-1)
author Matt Johnston <matt@ucc.asn.au>
date Tue, 24 Feb 2015 20:53:32 +0800
parents d3925ed45a85
children 2b4fd440399d
files common-channel.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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);
 	}
 }