summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2009-08-16 13:51:55 +0200
committerAndreas Schneider <mail@cynapses.org>2009-08-16 14:41:22 +0200
commitb0d6307d4172dd4b20d1d32d6bacc3228bfc096c (patch)
treea2ef5f27f7f635995e045a57ae9bee54e347289f
parent10920fc67816f8184499d83ca5786885730fa4b8 (diff)
downloadlibssh-b0d6307d4172dd4b20d1d32d6bacc3228bfc096c.tar.gz
libssh-b0d6307d4172dd4b20d1d32d6bacc3228bfc096c.tar.xz
libssh-b0d6307d4172dd4b20d1d32d6bacc3228bfc096c.zip
Fix channel_get_exit_status bug reported by VicLee
It would return -1 if the channel received the exit status and the close message at same time.
-rw-r--r--libssh/channels.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libssh/channels.c b/libssh/channels.c
index d10860ec..81b5f4c7 100644
--- a/libssh/channels.c
+++ b/libssh/channels.c
@@ -1661,7 +1661,9 @@ int channel_get_exit_status(CHANNEL *channel) {
return -1;
}
if (channel->open == 0) {
- return -1;
+ /* When a channel is closed, no exit status message can
+ * come anymore */
+ break;
}
}