From ab9439519ac3ca1ce5b273587544da3494f87308 Mon Sep 17 00:00:00 2001 From: Thorsten Horstmann Date: Tue, 24 Feb 2015 20:51:18 +0800 Subject: Fix for old compilers, variable declarations at beginning of functions and /**/ comments --- common-channel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'common-channel.c') diff --git a/common-channel.c b/common-channel.c index 049658d..db47695 100644 --- a/common-channel.c +++ b/common-channel.c @@ -402,7 +402,7 @@ static void check_in_progress(struct Channel *channel) { /* Send the close message and set the channel as closed */ static void send_msg_channel_close(struct Channel *channel) { - TRACE(("enter send_msg_channel_close %p", channel)) + TRACE(("enter send_msg_channel_close %p", (void*)channel)) if (channel->type->closehandler && !channel->close_handler_done) { channel->type->closehandler(channel); @@ -616,7 +616,7 @@ void recv_msg_channel_request() { channel = getchannel(); - TRACE(("enter recv_msg_channel_request %p", channel)) + TRACE(("enter recv_msg_channel_request %p", (void*)channel)) if (channel->sent_close) { TRACE(("leave recv_msg_channel_request: already closed channel")) @@ -1141,10 +1141,10 @@ void send_msg_request_failure() { } struct Channel* get_any_ready_channel() { + size_t i; if (ses.chancount == 0) { return NULL; } - size_t i; for (i = 0; i < ses.chansize; i++) { struct Channel *chan = ses.channels[i]; if (chan -- cgit v1.2.3 From 4b1f5ec7c29043a7d4ec0dd75f10479ed909a187 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Tue, 24 Feb 2015 20:53:32 +0800 Subject: Use m_close() which will avoid close(-1) --- common-channel.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'common-channel.c') 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); } } -- cgit v1.2.3