diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-06-04 00:01:40 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-06-06 23:00:01 -0700 |
| commit | 75014f7b1790e7ebdf13d38acc04dfdab6e450e9 (patch) | |
| tree | 46fb046e002a37ba60f6e8b8ef5ee0675fbb7fd8 /src/librustuv | |
| parent | d743b8831e6dc5b390af112cc23159d667cf583b (diff) | |
| download | rust-75014f7b1790e7ebdf13d38acc04dfdab6e450e9.tar.gz rust-75014f7b1790e7ebdf13d38acc04dfdab6e450e9.zip | |
libs: Fix miscellaneous fallout of librustrt
Diffstat (limited to 'src/librustuv')
| -rw-r--r-- | src/librustuv/lib.rs | 21 | ||||
| -rw-r--r-- | src/librustuv/uvll.rs | 5 |
2 files changed, 15 insertions, 11 deletions
diff --git a/src/librustuv/lib.rs b/src/librustuv/lib.rs index cbbb961e048..e2122aea036 100644 --- a/src/librustuv/lib.rs +++ b/src/librustuv/lib.rs @@ -404,22 +404,23 @@ pub fn uv_error_to_io_error(uverr: UvError) -> IoError { let UvError(errcode) = uverr; IoError { code: match errcode { - uvll::EOF => io::EOF, - uvll::EACCES => io::ERROR_ACCESS_DENIED, - uvll::ECONNREFUSED => io::WSAECONNREFUSED, - uvll::ECONNRESET => io::WSAECONNRESET, - uvll::ENOTCONN => io::WSAENOTCONN, - uvll::ENOENT => io::ERROR_NOT_FOUND, - uvll::EPIPE => io::ERROR_BROKEN_PIPE, - uvll::ECONNABORTED => io::WSAECONNABORTED, - uvll::EADDRNOTAVAIL => io::WSAEADDRNOTAVAIL, + uvll::EOF => libc::EOF, + uvll::EACCES => libc::ERROR_ACCESS_DENIED, + uvll::ECONNREFUSED => libc::WSAECONNREFUSED, + uvll::ECONNRESET => libc::WSAECONNRESET, + uvll::ENOTCONN => libc::WSAENOTCONN, + uvll::ENOENT => libc::ERROR_FILE_NOT_FOUND, + uvll::EPIPE => libc::ERROR_NO_DATA, + uvll::ECONNABORTED => libc::WSAECONNABORTED, + uvll::EADDRNOTAVAIL => libc::WSAEADDRNOTAVAIL, uvll::ECANCELED => libc::ERROR_OPERATION_ABORTED, + uvll::EADDRINUSE => libc::WSAEADDRINUSE, err => { uvdebug!("uverr.code {}", err as int); // FIXME: Need to map remaining uv error types -1 } - }, + } as uint, extra: 0, detail: Some(uverr.desc()), } diff --git a/src/librustuv/uvll.rs b/src/librustuv/uvll.rs index 91c68147251..f6c6d6c9068 100644 --- a/src/librustuv/uvll.rs +++ b/src/librustuv/uvll.rs @@ -38,7 +38,8 @@ use std::rt::libc_heap::malloc_raw; use libc::uintptr_t; pub use self::errors::{EACCES, ECONNREFUSED, ECONNRESET, EPIPE, ECONNABORTED, - ECANCELED, EBADF, ENOTCONN, ENOENT, EADDRNOTAVAIL}; + ECANCELED, EBADF, ENOTCONN, ENOENT, EADDRNOTAVAIL, + EADDRINUSE}; pub static OK: c_int = 0; pub static EOF: c_int = -4095; @@ -61,6 +62,7 @@ pub mod errors { pub static ECANCELED: c_int = -4081; pub static EBADF: c_int = -4083; pub static EADDRNOTAVAIL: c_int = -4090; + pub static EADDRINUSE: c_int = -4091; } #[cfg(not(windows))] pub mod errors { @@ -77,6 +79,7 @@ pub mod errors { pub static ECANCELED : c_int = -libc::ECANCELED; pub static EBADF : c_int = -libc::EBADF; pub static EADDRNOTAVAIL : c_int = -libc::EADDRNOTAVAIL; + pub static EADDRINUSE : c_int = -libc::EADDRINUSE; } pub static PROCESS_SETUID: c_int = 1 << 0; |
