Skip to content

Commit cc2897d

Browse files
committed
core: Replace use of libc::getenv with os::getenv
1 parent f6401ba commit cc2897d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/libcore/unstable/lang.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,16 +423,14 @@ pub unsafe fn strdup_uniq(ptr: *c_uchar, len: uint) -> ~str {
423423
#[lang="start"]
424424
pub fn start(main: *u8, argc: int, argv: **c_char,
425425
crate_map: *u8) -> int {
426-
use libc::getenv;
427426
use rt;
428427
use sys::Closure;
429428
use ptr;
430429
use cast;
430+
use os;
431431

432432
unsafe {
433-
let use_old_rt = do str::as_c_str("RUST_NEWRT") |s| {
434-
getenv(s).is_null()
435-
};
433+
let use_old_rt = os::getenv("RUST_NEWRT").is_none();
436434
if use_old_rt {
437435
return rust_start(main as *c_void, argc as c_int, argv,
438436
crate_map as *c_void) as int;

0 commit comments

Comments
 (0)