Skip to content

Commit 8aadcd4

Browse files
committed
std::rt: Add NotConnected to IoErrorKind
1 parent a402fb2 commit 8aadcd4

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/libstd/rt/io/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ pub enum IoErrorKind {
367367
Closed,
368368
ConnectionRefused,
369369
ConnectionReset,
370+
NotConnected,
370371
BrokenPipe,
371372
PathAlreadyExists,
372373
PathDoesntExist,
@@ -386,6 +387,7 @@ impl ToStr for IoErrorKind {
386387
Closed => ~"Closed",
387388
ConnectionRefused => ~"ConnectionRefused",
388389
ConnectionReset => ~"ConnectionReset",
390+
NotConnected => ~"NotConnected",
389391
BrokenPipe => ~"BrokenPipe",
390392
PathAlreadyExists => ~"PathAlreadyExists",
391393
PathDoesntExist => ~"PathDoesntExist",

src/libstd/rt/uv/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ pub fn uv_error_to_io_error(uverr: UvError) -> IoError {
267267
EACCES => PermissionDenied,
268268
ECONNREFUSED => ConnectionRefused,
269269
ECONNRESET => ConnectionReset,
270+
ENOTCONN => NotConnected,
270271
EPIPE => BrokenPipe,
271272
err => {
272273
rtdebug!("uverr.code {}", err as int);

src/libstd/rt/uv/uvll.rs

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ pub mod errors {
5353
pub static EACCES: c_int = -4093;
5454
pub static ECONNREFUSED: c_int = -4079;
5555
pub static ECONNRESET: c_int = -4078;
56+
pub static ENOTCONN: c_int = -4054;
5657
pub static EPIPE: c_int = -4048;
5758
}
5859
#[cfg(not(windows))]
@@ -63,6 +64,7 @@ pub mod errors {
6364
pub static EACCES: c_int = -libc::EACCES;
6465
pub static ECONNREFUSED: c_int = -libc::ECONNREFUSED;
6566
pub static ECONNRESET: c_int = -libc::ECONNRESET;
67+
pub static ENOTCONN: c_int = -libc::ENOTCONN;
6668
pub static EPIPE: c_int = -libc::EPIPE;
6769
}
6870

0 commit comments

Comments
 (0)