diff options
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/mod.rs | 5 | ||||
| -rw-r--r-- | src/libstd/io/net/tcp.rs | 3 | ||||
| -rw-r--r-- | src/libstd/lib.rs | 5 | ||||
| -rw-r--r-- | src/libstd/rt/backtrace.rs | 6 | ||||
| -rw-r--r-- | src/libstd/rt/mod.rs | 5 | ||||
| -rw-r--r-- | src/libstd/task.rs | 10 |
6 files changed, 13 insertions, 21 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 94d60cb3ce7..c72cc0ded9b 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -313,7 +313,8 @@ impl IoError { libc::ERROR_INVALID_NAME => (InvalidInput, "invalid file name"), libc::WSAECONNREFUSED => (ConnectionRefused, "connection refused"), libc::WSAECONNRESET => (ConnectionReset, "connection reset"), - libc::WSAEACCES => (PermissionDenied, "permission denied"), + libc::ERROR_ACCESS_DENIED | libc::WSAEACCES => + (PermissionDenied, "permission denied"), libc::WSAEWOULDBLOCK => { (ResourceUnavailable, "resource temporarily unavailable") } @@ -327,7 +328,7 @@ impl IoError { libc::WSAEINVAL => (InvalidInput, "invalid argument"), libc::ERROR_CALL_NOT_IMPLEMENTED => (IoUnavailable, "function not implemented"), - libc::ERROR_CALL_NOT_IMPLEMENTED => + libc::ERROR_INVALID_HANDLE => (MismatchedFileTypeForOperation, "invalid handle provided to function"), libc::ERROR_NOTHING_TO_TERMINATE => diff --git a/src/libstd/io/net/tcp.rs b/src/libstd/io/net/tcp.rs index 8ce77faa296..6c773467553 100644 --- a/src/libstd/io/net/tcp.rs +++ b/src/libstd/io/net/tcp.rs @@ -982,7 +982,8 @@ mod test { match TcpListener::bind(ip_str.as_slice(), port).listen() { Ok(..) => fail!(), Err(e) => { - assert!(e.kind == ConnectionRefused || e.kind == OtherIoError); + assert!(e.kind == ConnectionRefused || e.kind == OtherIoError, + "unknown error: {} {}", e, e.kind); } } }) diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index fe5fabef9d9..bac4d26b4e4 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -256,11 +256,6 @@ pub mod unstable; pub mod rt; mod failure; -#[doc(hidden)] -pub fn issue_14344_workaround() { // FIXME #14344 force linkage to happen correctly - libc::issue_14344_workaround(); -} - // A curious inner-module that's not exported that contains the binding // 'std' so that macro-expanded references to std::error and such // can be resolved within libstd. diff --git a/src/libstd/rt/backtrace.rs b/src/libstd/rt/backtrace.rs index 4229e9ad32c..766901fa04f 100644 --- a/src/libstd/rt/backtrace.rs +++ b/src/libstd/rt/backtrace.rs @@ -603,6 +603,7 @@ mod imp { mod imp { use c_str::CString; use container::Container; + use intrinsics; use io::{IoResult, Writer}; use libc; use mem; @@ -610,11 +611,10 @@ mod imp { use option::{Some, None}; use path::Path; use result::{Ok, Err}; + use rt::mutex::{StaticNativeMutex, NATIVE_MUTEX_INIT}; + use slice::ImmutableVector; use str::StrSlice; use unstable::dynamic_lib::DynamicLibrary; - use intrinsics; - use unstable::mutex::{StaticNativeMutex, NATIVE_MUTEX_INIT}; - use slice::ImmutableVector; #[allow(non_snake_case_functions)] extern "system" { diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs index e8df7465a74..a68a632bc37 100644 --- a/src/libstd/rt/mod.rs +++ b/src/libstd/rt/mod.rs @@ -57,10 +57,11 @@ Several modules in `core` are clients of `rt`: use failure; use rustrt; -// TODO: dox +// Reexport some of our utilities which are expected by other crates. pub use self::util::{default_sched_threads, min_stack, running_on_valgrind}; -// TODO: dox +// Reexport functionality from librustrt and other crates underneath the +// standard library which work together to create the entire runtime. pub use alloc::{heap, libc_heap}; pub use rustrt::{task, local, mutex, exclusive, stack, args, rtio}; pub use rustrt::{Stdio, Stdout, Stderr, begin_unwind, begin_unwind_fmt}; diff --git a/src/libstd/task.rs b/src/libstd/task.rs index 55ebba69d90..9ee62ee3d81 100644 --- a/src/libstd/task.rs +++ b/src/libstd/task.rs @@ -182,14 +182,8 @@ impl TaskBuilder { }; if stdout.is_some() || stderr.is_some() { t.spawn_sibling(opts, proc() { - match stdout { - Some(handle) => { let _ = stdio::set_stdout(handle); } - None => {} - } - match stderr { - Some(handle) => { let _ = stdio::set_stderr(handle); } - None => {} - } + let _ = stdout.map(stdio::set_stdout); + let _ = stderr.map(stdio::set_stderr); f(); }); } else { |
