From 7db4163ffd715b2480ff6e3e9056f371d2042d45 Mon Sep 17 00:00:00 2001 From: Peter Marheine Date: Mon, 12 Oct 2015 10:37:28 +0000 Subject: [PATCH] Don't use a Vec in os::current_exe on FreeBSD. --- src/libstd/sys/unix/os.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs index c0e75368f7459..6bda4e1e0e600 100644 --- a/src/libstd/sys/unix/os.rs +++ b/src/libstd/sys/unix/os.rs @@ -187,10 +187,10 @@ pub fn current_exe() -> io::Result { unsafe { use libc::funcs::bsd44::*; use libc::consts::os::extra::*; - let mut mib = vec![CTL_KERN as c_int, - KERN_PROC as c_int, - KERN_PROC_PATHNAME as c_int, - -1 as c_int]; + let mut mib = [CTL_KERN as c_int, + KERN_PROC as c_int, + KERN_PROC_PATHNAME as c_int, + -1 as c_int]; let mut sz: libc::size_t = 0; let err = sysctl(mib.as_mut_ptr(), mib.len() as ::libc::c_uint, ptr::null_mut(), &mut sz, ptr::null_mut(),