Skip to content

Commit

Permalink
Use env::current_exe
Browse files Browse the repository at this point in the history
  • Loading branch information
est31 committed Jun 10, 2018
1 parent 2c8a5be commit 9eaa9fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libstd/sys_common/addr2line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use libc::{mmap, size_t, PROT_READ, MAP_SHARED, MAP_FAILED};

use io;
use ptr;
use env;

use cell::UnsafeCell;
use marker::Sync;
Expand Down Expand Up @@ -47,7 +48,8 @@ struct Ctx {

impl Ctx {
fn init() -> io::Result<Ctx> {
let (_filename, file) = ::sys::backtrace::gnu::get_executable_filename()?;
let filename = env::current_exe()?;
let file = File::open(&filename)?;
let file_len = file.metadata()?.len();

let map_ptr = unsafe {
Expand Down

0 comments on commit 9eaa9fe

Please sign in to comment.