diff --git a/src/unix.rs b/src/unix.rs index 76a7712..7f87561 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -8,6 +8,7 @@ use crate::sys::{id_t, mbr_gid_to_uuid, mbr_uid_to_uuid, mbr_uuid_to_id}; use std::ffi::{CStr, CString}; use std::io; use std::mem; +use std::os::raw::c_char; use std::ptr; #[cfg(target_os = "macos")] use uuid::Uuid; @@ -29,7 +30,7 @@ const MAX_BUFSIZE: usize = 1_048_576; // 1MB /// Convert user name to uid. pub fn name_to_uid(name: &str) -> io::Result { let mut pwd = mem::MaybeUninit::::uninit(); - let mut buf = Vec::::with_capacity(INITIAL_BUFSIZE); + let mut buf = Vec::::with_capacity(INITIAL_BUFSIZE); let mut result = ptr::null_mut(); let cstr = CString::new(name)?; @@ -73,7 +74,7 @@ pub fn name_to_uid(name: &str) -> io::Result { /// Convert group name to gid. pub fn name_to_gid(name: &str) -> io::Result { let mut grp = mem::MaybeUninit::::uninit(); - let mut buf = Vec::::with_capacity(INITIAL_BUFSIZE); + let mut buf = Vec::::with_capacity(INITIAL_BUFSIZE); let mut result = ptr::null_mut(); let cstr = CString::new(name)?; @@ -117,7 +118,7 @@ pub fn name_to_gid(name: &str) -> io::Result { /// Convert uid to user name. pub fn uid_to_name(uid: uid_t) -> io::Result { let mut pwd = mem::MaybeUninit::::uninit(); - let mut buf = Vec::::with_capacity(INITIAL_BUFSIZE); + let mut buf = Vec::::with_capacity(INITIAL_BUFSIZE); let mut result = ptr::null_mut(); let mut ret; @@ -155,7 +156,7 @@ pub fn uid_to_name(uid: uid_t) -> io::Result { /// Convert gid to group name. pub fn gid_to_name(gid: gid_t) -> io::Result { let mut grp = mem::MaybeUninit::::uninit(); - let mut buf = Vec::::with_capacity(INITIAL_BUFSIZE); + let mut buf = Vec::::with_capacity(INITIAL_BUFSIZE); let mut result = ptr::null_mut(); let mut ret;