summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/backtrace.rs4
-rw-r--r--src/libstd/rt/mod.rs4
-rw-r--r--src/libstd/rt/util.rs9
3 files changed, 9 insertions, 8 deletions
diff --git a/src/libstd/rt/backtrace.rs b/src/libstd/rt/backtrace.rs
index f2d66e1a4d7..905cc06c4f0 100644
--- a/src/libstd/rt/backtrace.rs
+++ b/src/libstd/rt/backtrace.rs
@@ -14,7 +14,7 @@
 
 use prelude::v1::*;
 
-use os;
+use env;
 use sync::atomic::{self, Ordering};
 
 pub use sys::backtrace::write;
@@ -29,7 +29,7 @@ pub fn log_enabled() -> bool {
         _ => {}
     }
 
-    let val = match os::getenv("RUST_BACKTRACE") {
+    let val = match env::var("RUST_BACKTRACE") {
         Some(..) => 2,
         None => 1,
     };
diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs
index 7e19f1cac2c..00088d6d99a 100644
--- a/src/libstd/rt/mod.rs
+++ b/src/libstd/rt/mod.rs
@@ -65,7 +65,7 @@ fn lang_start(main: *const u8, argc: int, argv: *const *const u8) -> int {
     use prelude::v1::*;
 
     use mem;
-    use os;
+    use env;
     use rt;
     use sys_common::thread_info::{self, NewThread};
     use sys_common;
@@ -131,7 +131,7 @@ fn lang_start(main: *const u8, argc: int, argv: *const *const u8) -> int {
     if failed {
         rt::DEFAULT_ERROR_CODE
     } else {
-        os::get_exit_status()
+        env::get_exit_status() as isize
     }
 }
 
diff --git a/src/libstd/rt/util.rs b/src/libstd/rt/util.rs
index f5727a38b69..86d21cf7278 100644
--- a/src/libstd/rt/util.rs
+++ b/src/libstd/rt/util.rs
@@ -13,6 +13,7 @@
 use prelude::v1::*;
 
 use cmp;
+use env;
 use fmt;
 use intrinsics;
 use libc::{self, uintptr_t};
@@ -51,7 +52,7 @@ pub fn min_stack() -> uint {
         0 => {}
         n => return n - 1,
     }
-    let amt = os::getenv("RUST_MIN_STACK").and_then(|s| s.parse().ok());
+    let amt = env::var_string("RUST_MIN_STACK").ok().and_then(|s| s.parse().ok());
     let amt = amt.unwrap_or(2 * 1024 * 1024);
     // 0 is our sentinel value, so ensure that we'll never see 0 after
     // initialization has run
@@ -62,15 +63,15 @@ pub fn min_stack() -> uint {
 /// Get's the number of scheduler threads requested by the environment
 /// either `RUST_THREADS` or `num_cpus`.
 pub fn default_sched_threads() -> uint {
-    match os::getenv("RUST_THREADS") {
-        Some(nstr) => {
+    match env::var_string("RUST_THREADS") {
+        Ok(nstr) => {
             let opt_n: Option<uint> = nstr.parse().ok();
             match opt_n {
                 Some(n) if n > 0 => n,
                 _ => panic!("`RUST_THREADS` is `{}`, should be a positive integer", nstr)
             }
         }
-        None => {
+        Err(..) => {
             if limit_thread_creation_due_to_osx_and_valgrind() {
                 1
             } else {