about summary refs log tree commit diff
path: root/src/libstd/io/stdio.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-11-02 16:23:22 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-11-09 22:55:50 -0800
commit3d28b8b98e6e4f55ef4ecd8babf0a050f48a3d11 (patch)
tree343087c9e62da65e2780db851682280697064c5b /src/libstd/io/stdio.rs
parentc8a29c2092cec369a751051a2bfed093522ff6e8 (diff)
downloadrust-3d28b8b98e6e4f55ef4ecd8babf0a050f48a3d11.tar.gz
rust-3d28b8b98e6e4f55ef4ecd8babf0a050f48a3d11.zip
std: Migrate to the new libc
* Delete `sys::unix::{c, sync}` as these are now all folded into libc itself
* Update all references to use `libc` as a result.
* Update all references to the new flat namespace.
* Moves all windows bindings into sys::c
Diffstat (limited to 'src/libstd/io/stdio.rs')
-rw-r--r--src/libstd/io/stdio.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs
index d6a9778ced2..985dbdd895f 100644
--- a/src/libstd/io/stdio.rs
+++ b/src/libstd/io/stdio.rs
@@ -16,7 +16,6 @@ use cmp;
 use fmt;
 use io::lazy::Lazy;
 use io::{self, BufReader, LineWriter};
-use libc;
 use sync::{Arc, Mutex, MutexGuard};
 use sys::stdio;
 use sys_common::io::{read_to_end_uninitialized};
@@ -121,9 +120,9 @@ impl<R: io::Read> io::Read for Maybe<R> {
 
 fn handle_ebadf<T>(r: io::Result<T>, default: T) -> io::Result<T> {
     #[cfg(windows)]
-    const ERR: libc::c_int = libc::ERROR_INVALID_HANDLE;
+    const ERR: i32 = ::sys::c::ERROR_INVALID_HANDLE as i32;
     #[cfg(not(windows))]
-    const ERR: libc::c_int = libc::EBADF;
+    const ERR: i32 = ::libc::EBADF as i32;
 
     match r {
         Err(ref e) if e.raw_os_error() == Some(ERR) => Ok(default),