Skip to content

Commit

Permalink
Use ErrorKind::Interrupted instead of WouldBlock
Browse files Browse the repository at this point in the history
std function expect std::io::ErrorKind::Interrupted to be returned
when doing blocking operations. Instead we were returning WouldBlock.
  • Loading branch information
equalsraf committed Feb 16, 2016
1 parent 7d34eee commit 5772715
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions telos/src/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ impl Error for TlsError {
&self.msg
}
}
/// Convert TlsError to io::Error, use WouldBlock if applicable
/// Convert TlsError to io::Error, use std::io::ErrorKindInterrupted if applicable
impl convert::From<TlsError> for io::Error {
fn from(err: TlsError) -> Self {
match err.code {
ffi::WANT_POLLIN | ffi::WANT_POLLOUT => io::Error::new(io::ErrorKind::WouldBlock, err),
ffi::WANT_POLLIN | ffi::WANT_POLLOUT => io::Error::new(io::ErrorKind::Interrupted, err),
_ => io::Error::new(io::ErrorKind::Other, err.msg),
}
}
Expand Down

0 comments on commit 5772715

Please sign in to comment.