summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2015-02-24 20:53:32 +0800
committerMatt Johnston <matt@ucc.asn.au>2015-02-24 20:53:32 +0800
commit1908a6a766eeee58929c55c487aab0a59aa8090b (patch)
treece0636806c94bc94aa4e6bed9ef43cd61beb2c6f
parent18194ed2d1a30eae89fa071bc4b78a5d257eae2d (diff)
downloaddropbear-1908a6a766eeee58929c55c487aab0a59aa8090b.tar.gz
Use m_close() which will avoid close(-1)
-rw-r--r--common-channel.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/common-channel.c b/common-channel.c
index db47695..a683448 100644
--- a/common-channel.c
+++ b/common-channel.c
@@ -586,11 +586,11 @@ static void remove_channel(struct Channel * channel) {
/* 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 @@ static void close_chan_fd(struct Channel *channel, int fd, int how) {
}
} else {
TRACE(("CLOSE some fd %d", fd))
- close(fd);
+ m_close(fd);
closein = closeout = 1;
}
@@ -1024,7 +1024,7 @@ static void close_chan_fd(struct Channel *channel, int fd, int how) {
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);
}
}