diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2009-08-16 13:51:55 +0200 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-08-16 14:41:22 +0200 |
commit | b0d6307d4172dd4b20d1d32d6bacc3228bfc096c (patch) | |
tree | a2ef5f27f7f635995e045a57ae9bee54e347289f | |
parent | 10920fc67816f8184499d83ca5786885730fa4b8 (diff) | |
download | libssh-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.c | 4 |
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; } } |