From 5772715e2f918442c939613b9a47f6cba25f636a Mon Sep 17 00:00:00 2001 From: Rui Abreu Ferreira Date: Tue, 16 Feb 2016 22:30:16 +0000 Subject: [PATCH] Use ErrorKind::Interrupted instead of WouldBlock std function expect std::io::ErrorKind::Interrupted to be returned when doing blocking operations. Instead we were returning WouldBlock. --- telos/src/raw.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telos/src/raw.rs b/telos/src/raw.rs index cfd5cc6..e1aa3cc 100644 --- a/telos/src/raw.rs +++ b/telos/src/raw.rs @@ -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 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), } }