diff options
author | Aidan Hobson Sayers <aidanhs@cantab.net> | 2016-04-28 22:36:37 +0100 |
---|---|---|
committer | Aidan Hobson Sayers <aidanhs@cantab.net> | 2016-04-28 23:16:21 +0100 |
commit | ff42317cbd9b5e206d5460e15cc9f426efc1f459 (patch) | |
tree | 95d95c42ec1c84e4327538f3012d37af85f3be7a /src | |
parent | bcb2f65c0e1fd2df2395aa37af51140adb1a5d5f (diff) | |
download | ssh2-rs-ff42317cbd9b5e206d5460e15cc9f426efc1f459.zip |
The libssh2 exit_status code effectively never errors
Diffstat (limited to 'src')
-rw-r--r-- | src/channel.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/channel.rs b/src/channel.rs index d7d9b20..fda9123 100644 --- a/src/channel.rs +++ b/src/channel.rs @@ -199,11 +199,11 @@ impl<'sess> Channel<'sess> { /// Note that the exit status may not be available if the remote end has not /// yet set its status to closed. pub fn exit_status(&self) -> Result<i32, Error> { - let ret = unsafe { raw::libssh2_channel_get_exit_status(self.raw) }; - match Error::last_error(self.sess) { - Some(err) => Err(err), - None => Ok(ret as i32) - } + // Should really store existing error, call function, check for error + // after and restore previous error if no new one...but the only error + // condition right now is a NULL pointer check on self.raw, so let's + // assume that's not the case. + Ok(unsafe { raw::libssh2_channel_get_exit_status(self.raw) }) } /// Get the remote exit signal. |