core::rt: Fix TCP test on mac

This commit is contained in:
Brian Anderson
2013-05-14 21:18:47 -07:00
parent 2bc1e6ba60
commit d951da8276
4 changed files with 8 additions and 3 deletions
+2 -1
View File
@@ -348,7 +348,8 @@ pub enum IoErrorKind {
ConnectionFailed,
Closed,
ConnectionRefused,
ConnectionReset
ConnectionReset,
BrokenPipe
}
// XXX: Can't put doc comments on macros
+2 -1
View File
@@ -233,7 +233,8 @@ fn write_close() {
loop {
let mut stop = false;
do io_error::cond.trap(|e| {
assert!(e.kind == ConnectionReset);
// NB: ECONNRESET on linux, EPIPE on mac
assert!(e.kind == ConnectionReset || e.kind == BrokenPipe);
stop = true;
}).in {
stream.write(buf);
+3 -1
View File
@@ -272,7 +272,9 @@ unsafe fn c_str_to_static_slice(s: *libc::c_char) -> &'static str {
EACCES => PermissionDenied,
ECONNREFUSED => ConnectionRefused,
ECONNRESET => ConnectionReset,
_ => {
EPIPE => BrokenPipe,
e => {
rtdebug!("e %u", e as uint);
// XXX: Need to map remaining uv error types
OtherIoError
}
+1
View File
@@ -40,6 +40,7 @@
pub static EACCES: c_int = 3;
pub static ECONNREFUSED: c_int = 12;
pub static ECONNRESET: c_int = 13;
pub static EPIPE: c_int = 36;
pub struct uv_err_t {
code: c_int,