std::rt: Add NotConnected to IoErrorKind

This commit is contained in:
klutzy 2013-10-05 06:10:02 +09:00
parent a402fb27fa
commit 8aadcd4851
3 changed files with 5 additions and 0 deletions

View File

@ -367,6 +367,7 @@ pub enum IoErrorKind {
Closed,
ConnectionRefused,
ConnectionReset,
NotConnected,
BrokenPipe,
PathAlreadyExists,
PathDoesntExist,
@ -386,6 +387,7 @@ impl ToStr for IoErrorKind {
Closed => ~"Closed",
ConnectionRefused => ~"ConnectionRefused",
ConnectionReset => ~"ConnectionReset",
NotConnected => ~"NotConnected",
BrokenPipe => ~"BrokenPipe",
PathAlreadyExists => ~"PathAlreadyExists",
PathDoesntExist => ~"PathDoesntExist",

View File

@ -267,6 +267,7 @@ pub fn uv_error_to_io_error(uverr: UvError) -> IoError {
EACCES => PermissionDenied,
ECONNREFUSED => ConnectionRefused,
ECONNRESET => ConnectionReset,
ENOTCONN => NotConnected,
EPIPE => BrokenPipe,
err => {
rtdebug!("uverr.code {}", err as int);

View File

@ -53,6 +53,7 @@ pub mod errors {
pub static EACCES: c_int = -4093;
pub static ECONNREFUSED: c_int = -4079;
pub static ECONNRESET: c_int = -4078;
pub static ENOTCONN: c_int = -4054;
pub static EPIPE: c_int = -4048;
}
#[cfg(not(windows))]
@ -63,6 +64,7 @@ pub mod errors {
pub static EACCES: c_int = -libc::EACCES;
pub static ECONNREFUSED: c_int = -libc::ECONNREFUSED;
pub static ECONNRESET: c_int = -libc::ECONNRESET;
pub static ENOTCONN: c_int = -libc::ENOTCONN;
pub static EPIPE: c_int = -libc::EPIPE;
}