summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAidan Hobson Sayers <aidanhs@cantab.net>2016-04-28 22:36:37 +0100
committerAidan Hobson Sayers <aidanhs@cantab.net>2016-04-28 23:16:21 +0100
commitff42317cbd9b5e206d5460e15cc9f426efc1f459 (patch)
tree95d95c42ec1c84e4327538f3012d37af85f3be7a /src
parentbcb2f65c0e1fd2df2395aa37af51140adb1a5d5f (diff)
downloadssh2-rs-ff42317cbd9b5e206d5460e15cc9f426efc1f459.zip
The libssh2 exit_status code effectively never errors
Diffstat (limited to 'src')
-rw-r--r--src/channel.rs10
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.