From e707af1cd78f730e80da7b109ee33985d0ee3419 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(-) diff --git a/libssh/channels.c b/libssh/channels.c index c006d248..ac49b381 100644 --- a/libssh/channels.c +++ b/libssh/channels.c @@ -1793,7 +1793,9 @@ int channel_get_exit_status(ssh_channel channel) { return -1; } if (channel->open == 0) { - return -1; + /* When a channel is closed, no exit status message can + * come anymore */ + break; } } -- cgit