From b0d6307d4172dd4b20d1d32d6bacc3228bfc096c Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Sun, 16 Aug 2009 13:51:55 +0200 Subject: 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. --- libssh/channels.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libssh') 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; } } -- cgit v1.2.3