Skip to content

std: Stabilize portions of std::os::$platform #23353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/libstd/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ pub fn getenv_as_bytes(n: &str) -> Option<Vec<u8>> {

#[cfg(unix)]
fn byteify(s: OsString) -> Vec<u8> {
use os::unix::*;
use os::unix::prelude::*;
s.into_vec()
}
#[cfg(windows)]
Expand Down Expand Up @@ -238,7 +238,7 @@ fn byteify(s: OsString) -> Vec<u8> {
pub fn setenv<T: BytesContainer>(n: &str, v: T) {
#[cfg(unix)]
fn _setenv(n: &str, v: &[u8]) {
use os::unix::*;
use os::unix::prelude::*;
let v: OsString = OsStringExt::from_vec(v.to_vec());
env::set_var(n, &v)
}
Expand Down Expand Up @@ -1705,13 +1705,13 @@ mod tests {

#[cfg(not(windows))]
fn get_fd(file: &File) -> libc::c_int {
use os::unix::AsRawFd;
use os::unix::prelude::*;
file.as_raw_fd()
}

#[cfg(windows)]
fn get_fd(file: &File) -> libc::HANDLE {
use os::windows::AsRawHandle;
use os::windows::prelude::*;
file.as_raw_handle()
}

Expand Down
6 changes: 3 additions & 3 deletions src/libstd/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ mod tests {
#[cfg(all(unix, not(target_os="android")))]
#[test]
fn signal_reported_right() {
use os::unix::ExitStatusExt;
use os::unix::process::ExitStatusExt;

let p = Command::new("/bin/sh").arg("-c").arg("kill -9 $$").spawn();
assert!(p.is_ok());
Expand Down Expand Up @@ -633,7 +633,7 @@ mod tests {
#[cfg(all(unix, not(target_os="android")))]
#[test]
fn uid_works() {
use os::unix::*;
use os::unix::prelude::*;
use libc;
let mut p = Command::new("/bin/sh")
.arg("-c").arg("true")
Expand All @@ -646,7 +646,7 @@ mod tests {
#[cfg(all(unix, not(target_os="android")))]
#[test]
fn uid_to_root_fails() {
use os::unix::*;
use os::unix::prelude::*;
use libc;

// if we're already root, this isn't a valid test. Most of the bots run
Expand Down
Loading