1
Fork 0

std: Rename sys::foo2 modules to sys::foo

Now that `std::old_io` has been removed for quite some time the naming real
estate here has opened up to allow these modules to move back to their proper
names.
This commit is contained in:
Alex Crichton 2015-05-05 16:35:15 -07:00
parent 05d5fcaa5b
commit 377b1adc36
29 changed files with 47 additions and 47 deletions

View file

@ -23,7 +23,7 @@ use fmt;
use ffi::OsString; use ffi::OsString;
use io::{self, Error, ErrorKind, SeekFrom, Seek, Read, Write}; use io::{self, Error, ErrorKind, SeekFrom, Seek, Read, Write};
use path::{Path, PathBuf}; use path::{Path, PathBuf};
use sys::fs2 as fs_imp; use sys::fs as fs_imp;
use sys_common::{AsInnerMut, FromInner, AsInner}; use sys_common::{AsInnerMut, FromInner, AsInner};
use vec::Vec; use vec::Vec;

View file

@ -15,7 +15,7 @@
use prelude::v1::*; use prelude::v1::*;
use io::{self, Error, ErrorKind}; use io::{self, Error, ErrorKind};
use sys_common::net2 as net_imp; use sys_common::net as net_imp;
pub use self::ip::{IpAddr, Ipv4Addr, Ipv6Addr, Ipv6MulticastScope}; pub use self::ip::{IpAddr, Ipv4Addr, Ipv6Addr, Ipv6MulticastScope};
pub use self::addr::{SocketAddr, SocketAddrV4, SocketAddrV6, ToSocketAddrs}; pub use self::addr::{SocketAddr, SocketAddrV4, SocketAddrV6, ToSocketAddrs};

View file

@ -17,7 +17,7 @@ use io::prelude::*;
use fmt; use fmt;
use io; use io;
use net::{ToSocketAddrs, SocketAddr, Shutdown}; use net::{ToSocketAddrs, SocketAddr, Shutdown};
use sys_common::net2 as net_imp; use sys_common::net as net_imp;
use sys_common::{AsInner, FromInner}; use sys_common::{AsInner, FromInner};
/// A structure which represents a TCP stream between a local socket and a /// A structure which represents a TCP stream between a local socket and a

View file

@ -16,7 +16,7 @@ use prelude::v1::*;
use fmt; use fmt;
use io::{self, Error, ErrorKind}; use io::{self, Error, ErrorKind};
use net::{ToSocketAddrs, SocketAddr, IpAddr}; use net::{ToSocketAddrs, SocketAddr, IpAddr};
use sys_common::net2 as net_imp; use sys_common::net as net_imp;
use sys_common::{AsInner, FromInner}; use sys_common::{AsInner, FromInner};
/// A User Datagram Protocol socket. /// A User Datagram Protocol socket.

View file

@ -15,5 +15,5 @@
pub mod raw; pub mod raw;
pub mod fs { pub mod fs {
pub use sys::fs2::MetadataExt; pub use sys::fs::MetadataExt;
} }

View file

@ -15,5 +15,5 @@
pub mod raw; pub mod raw;
pub mod fs { pub mod fs {
pub use sys::fs2::MetadataExt; pub use sys::fs::MetadataExt;
} }

View file

@ -15,5 +15,5 @@
pub mod raw; pub mod raw;
pub mod fs { pub mod fs {
pub use sys::fs2::MetadataExt; pub use sys::fs::MetadataExt;
} }

View file

@ -15,5 +15,5 @@
pub mod raw; pub mod raw;
pub mod fs { pub mod fs {
pub use sys::fs2::MetadataExt; pub use sys::fs::MetadataExt;
} }

View file

@ -15,5 +15,5 @@
pub mod raw; pub mod raw;
pub mod fs { pub mod fs {
pub use sys::fs2::MetadataExt; pub use sys::fs::MetadataExt;
} }

View file

@ -15,5 +15,5 @@
pub mod raw; pub mod raw;
pub mod fs { pub mod fs {
pub use sys::fs2::MetadataExt; pub use sys::fs::MetadataExt;
} }

View file

@ -15,5 +15,5 @@
pub mod raw; pub mod raw;
pub mod fs { pub mod fs {
pub use sys::fs2::MetadataExt; pub use sys::fs::MetadataExt;
} }

View file

@ -15,5 +15,5 @@
pub mod raw; pub mod raw;
pub mod fs { pub mod fs {
pub use sys::fs2::MetadataExt; pub use sys::fs::MetadataExt;
} }

View file

@ -15,5 +15,5 @@
pub mod raw; pub mod raw;
pub mod fs { pub mod fs {
pub use sys::fs2::MetadataExt; pub use sys::fs::MetadataExt;
} }

View file

@ -21,11 +21,11 @@ use fmt;
use io::{self, Error, ErrorKind}; use io::{self, Error, ErrorKind};
use path; use path;
use sync::mpsc::{channel, Receiver}; use sync::mpsc::{channel, Receiver};
use sys::pipe2::{self, AnonPipe}; use sys::pipe::{self, AnonPipe};
use sys::process2::Command as CommandImp; use sys::process::Command as CommandImp;
use sys::process2::Process as ProcessImp; use sys::process::Process as ProcessImp;
use sys::process2::ExitStatus as ExitStatusImp; use sys::process::ExitStatus as ExitStatusImp;
use sys::process2::Stdio as StdioImp2; use sys::process::Stdio as StdioImp2;
use sys_common::{AsInner, AsInnerMut}; use sys_common::{AsInner, AsInnerMut};
use thread; use thread;
@ -334,7 +334,7 @@ fn setup_io(io: &StdioImp, readable: bool)
Null => (StdioImp2::None, None), Null => (StdioImp2::None, None),
Inherit => (StdioImp2::Inherit, None), Inherit => (StdioImp2::Inherit, None),
Piped => { Piped => {
let (reader, writer) = try!(pipe2::anon_pipe()); let (reader, writer) = try!(pipe::anon_pipe());
if readable { if readable {
(StdioImp2::Piped(reader), Some(writer)) (StdioImp2::Piped(reader), Some(writer))
} else { } else {

View file

@ -15,7 +15,7 @@ use prelude::v1::*;
pub mod backtrace; pub mod backtrace;
pub mod condvar; pub mod condvar;
pub mod mutex; pub mod mutex;
pub mod net2; pub mod net;
pub mod poison; pub mod poison;
pub mod remutex; pub mod remutex;
pub mod rwlock; pub mod rwlock;

View file

@ -102,7 +102,7 @@ impl OpenOptionsExt for OpenOptions {
} }
#[unstable(feature = "metadata_ext", reason = "recently added API")] #[unstable(feature = "metadata_ext", reason = "recently added API")]
pub struct Metadata(sys::fs2::FileAttr); pub struct Metadata(sys::fs::FileAttr);
#[unstable(feature = "metadata_ext", reason = "recently added API")] #[unstable(feature = "metadata_ext", reason = "recently added API")]
pub trait MetadataExt { pub trait MetadataExt {
@ -111,7 +111,7 @@ pub trait MetadataExt {
impl MetadataExt for fs::Metadata { impl MetadataExt for fs::Metadata {
fn as_raw(&self) -> &Metadata { fn as_raw(&self) -> &Metadata {
let inner: &sys::fs2::FileAttr = self.as_inner(); let inner: &sys::fs::FileAttr = self.as_inner();
unsafe { mem::transmute(inner) } unsafe { mem::transmute(inner) }
} }
} }
@ -187,7 +187,7 @@ impl DirEntryExt for fs::DirEntry {
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) -> io::Result<()> pub fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) -> io::Result<()>
{ {
sys::fs2::symlink(src.as_ref(), dst.as_ref()) sys::fs::symlink(src.as_ref(), dst.as_ref())
} }
#[unstable(feature = "dir_builder", reason = "recently added API")] #[unstable(feature = "dir_builder", reason = "recently added API")]

View file

@ -16,7 +16,7 @@ use fs;
use net; use net;
use os::raw; use os::raw;
use sys; use sys;
use sys_common::{net2, AsInner, FromInner}; use sys_common::{self, AsInner, FromInner};
/// Raw file descriptors. /// Raw file descriptors.
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
@ -68,7 +68,7 @@ impl AsRawFd for fs::File {
#[stable(feature = "from_raw_os", since = "1.1.0")] #[stable(feature = "from_raw_os", since = "1.1.0")]
impl FromRawFd for fs::File { impl FromRawFd for fs::File {
unsafe fn from_raw_fd(fd: RawFd) -> fs::File { unsafe fn from_raw_fd(fd: RawFd) -> fs::File {
fs::File::from_inner(sys::fs2::File::from_inner(fd)) fs::File::from_inner(sys::fs::File::from_inner(fd))
} }
} }
@ -89,20 +89,20 @@ impl AsRawFd for net::UdpSocket {
impl FromRawFd for net::TcpStream { impl FromRawFd for net::TcpStream {
unsafe fn from_raw_fd(fd: RawFd) -> net::TcpStream { unsafe fn from_raw_fd(fd: RawFd) -> net::TcpStream {
let socket = sys::net::Socket::from_inner(fd); let socket = sys::net::Socket::from_inner(fd);
net::TcpStream::from_inner(net2::TcpStream::from_inner(socket)) net::TcpStream::from_inner(sys_common::net::TcpStream::from_inner(socket))
} }
} }
#[stable(feature = "from_raw_os", since = "1.1.0")] #[stable(feature = "from_raw_os", since = "1.1.0")]
impl FromRawFd for net::TcpListener { impl FromRawFd for net::TcpListener {
unsafe fn from_raw_fd(fd: RawFd) -> net::TcpListener { unsafe fn from_raw_fd(fd: RawFd) -> net::TcpListener {
let socket = sys::net::Socket::from_inner(fd); let socket = sys::net::Socket::from_inner(fd);
net::TcpListener::from_inner(net2::TcpListener::from_inner(socket)) net::TcpListener::from_inner(sys_common::net::TcpListener::from_inner(socket))
} }
} }
#[stable(feature = "from_raw_os", since = "1.1.0")] #[stable(feature = "from_raw_os", since = "1.1.0")]
impl FromRawFd for net::UdpSocket { impl FromRawFd for net::UdpSocket {
unsafe fn from_raw_fd(fd: RawFd) -> net::UdpSocket { unsafe fn from_raw_fd(fd: RawFd) -> net::UdpSocket {
let socket = sys::net::Socket::from_inner(fd); let socket = sys::net::Socket::from_inner(fd);
net::UdpSocket::from_inner(net2::UdpSocket::from_inner(socket)) net::UdpSocket::from_inner(sys_common::net::UdpSocket::from_inner(socket))
} }
} }

View file

@ -58,7 +58,7 @@ pub trait ExitStatusExt {
impl ExitStatusExt for process::ExitStatus { impl ExitStatusExt for process::ExitStatus {
fn signal(&self) -> Option<i32> { fn signal(&self) -> Option<i32> {
match *self.as_inner() { match *self.as_inner() {
sys::process2::ExitStatus::Signal(s) => Some(s), sys::process::ExitStatus::Signal(s) => Some(s),
_ => None _ => None
} }
} }

View file

@ -33,13 +33,13 @@ pub mod c;
pub mod condvar; pub mod condvar;
pub mod ext; pub mod ext;
pub mod fd; pub mod fd;
pub mod fs2; pub mod fs;
pub mod mutex; pub mod mutex;
pub mod net; pub mod net;
pub mod os; pub mod os;
pub mod os_str; pub mod os_str;
pub mod pipe2; pub mod pipe;
pub mod process2; pub mod process;
pub mod rwlock; pub mod rwlock;
pub mod stack_overflow; pub mod stack_overflow;
pub mod sync; pub mod sync;

View file

@ -18,9 +18,9 @@ use fmt;
use io::{self, Error, ErrorKind}; use io::{self, Error, ErrorKind};
use libc::{self, pid_t, c_void, c_int, gid_t, uid_t}; use libc::{self, pid_t, c_void, c_int, gid_t, uid_t};
use ptr; use ptr;
use sys::pipe2::AnonPipe; use sys::pipe::AnonPipe;
use sys::{self, c, cvt, cvt_r}; use sys::{self, c, cvt, cvt_r};
use sys::fs2::{File, OpenOptions}; use sys::fs::{File, OpenOptions};
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Command // Command
@ -141,7 +141,7 @@ impl Process {
let (envp, _a, _b) = make_envp(cfg.env.as_ref()); let (envp, _a, _b) = make_envp(cfg.env.as_ref());
let (argv, _a) = make_argv(&cfg.program, &cfg.args); let (argv, _a) = make_argv(&cfg.program, &cfg.args);
let (input, output) = try!(sys::pipe2::anon_pipe()); let (input, output) = try!(sys::pipe::anon_pipe());
let pid = unsafe { let pid = unsafe {
match libc::fork() { match libc::fork() {

View file

@ -125,7 +125,7 @@ impl MetadataExt for Metadata {
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub fn symlink_file<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) pub fn symlink_file<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q)
-> io::Result<()> { -> io::Result<()> {
sys::fs2::symlink_inner(src.as_ref(), dst.as_ref(), false) sys::fs::symlink_inner(src.as_ref(), dst.as_ref(), false)
} }
/// Creates a new directory symlink on the filesystem. /// Creates a new directory symlink on the filesystem.
@ -146,5 +146,5 @@ pub fn symlink_file<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q)
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub fn symlink_dir<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) pub fn symlink_dir<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q)
-> io::Result<()> { -> io::Result<()> {
sys::fs2::symlink_inner(src.as_ref(), dst.as_ref(), true) sys::fs::symlink_inner(src.as_ref(), dst.as_ref(), true)
} }

View file

@ -13,7 +13,7 @@
use fs; use fs;
use os::windows::raw; use os::windows::raw;
use net; use net;
use sys_common::{net2, AsInner, FromInner}; use sys_common::{self, AsInner, FromInner};
use sys; use sys;
/// Raw HANDLEs. /// Raw HANDLEs.
@ -61,7 +61,7 @@ impl AsRawHandle for fs::File {
impl FromRawHandle for fs::File { impl FromRawHandle for fs::File {
unsafe fn from_raw_handle(handle: RawHandle) -> fs::File { unsafe fn from_raw_handle(handle: RawHandle) -> fs::File {
let handle = handle as ::libc::HANDLE; let handle = handle as ::libc::HANDLE;
fs::File::from_inner(sys::fs2::File::from_inner(handle)) fs::File::from_inner(sys::fs::File::from_inner(handle))
} }
} }
@ -113,20 +113,20 @@ impl AsRawSocket for net::UdpSocket {
impl FromRawSocket for net::TcpStream { impl FromRawSocket for net::TcpStream {
unsafe fn from_raw_socket(sock: RawSocket) -> net::TcpStream { unsafe fn from_raw_socket(sock: RawSocket) -> net::TcpStream {
let sock = sys::net::Socket::from_inner(sock); let sock = sys::net::Socket::from_inner(sock);
net::TcpStream::from_inner(net2::TcpStream::from_inner(sock)) net::TcpStream::from_inner(sys_common::net::TcpStream::from_inner(sock))
} }
} }
#[stable(feature = "from_raw_os", since = "1.1.0")] #[stable(feature = "from_raw_os", since = "1.1.0")]
impl FromRawSocket for net::TcpListener { impl FromRawSocket for net::TcpListener {
unsafe fn from_raw_socket(sock: RawSocket) -> net::TcpListener { unsafe fn from_raw_socket(sock: RawSocket) -> net::TcpListener {
let sock = sys::net::Socket::from_inner(sock); let sock = sys::net::Socket::from_inner(sock);
net::TcpListener::from_inner(net2::TcpListener::from_inner(sock)) net::TcpListener::from_inner(sys_common::net::TcpListener::from_inner(sock))
} }
} }
#[stable(feature = "from_raw_os", since = "1.1.0")] #[stable(feature = "from_raw_os", since = "1.1.0")]
impl FromRawSocket for net::UdpSocket { impl FromRawSocket for net::UdpSocket {
unsafe fn from_raw_socket(sock: RawSocket) -> net::UdpSocket { unsafe fn from_raw_socket(sock: RawSocket) -> net::UdpSocket {
let sock = sys::net::Socket::from_inner(sock); let sock = sys::net::Socket::from_inner(sock);
net::UdpSocket::from_inner(net2::UdpSocket::from_inner(sock)) net::UdpSocket::from_inner(sys_common::net::UdpSocket::from_inner(sock))
} }
} }

View file

@ -25,14 +25,14 @@ pub mod backtrace;
pub mod c; pub mod c;
pub mod condvar; pub mod condvar;
pub mod ext; pub mod ext;
pub mod fs2; pub mod fs;
pub mod handle; pub mod handle;
pub mod mutex; pub mod mutex;
pub mod net; pub mod net;
pub mod os; pub mod os;
pub mod os_str; pub mod os_str;
pub mod pipe2; pub mod pipe;
pub mod process2; pub mod process;
pub mod rwlock; pub mod rwlock;
pub mod stack_overflow; pub mod stack_overflow;
pub mod sync; pub mod sync;

View file

@ -26,9 +26,9 @@ use path::Path;
use ptr; use ptr;
use sync::{StaticMutex, MUTEX_INIT}; use sync::{StaticMutex, MUTEX_INIT};
use sys::c; use sys::c;
use sys::fs2::{OpenOptions, File}; use sys::fs::{OpenOptions, File};
use sys::handle::Handle; use sys::handle::Handle;
use sys::pipe2::AnonPipe; use sys::pipe::AnonPipe;
use sys::stdio; use sys::stdio;
use sys::{self, cvt}; use sys::{self, cvt};
use sys_common::{AsInner, FromInner}; use sys_common::{AsInner, FromInner};