aboutsummaryrefslogtreecommitdiff
path: root/ctr-std/src/sys/unix/os.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ctr-std/src/sys/unix/os.rs')
-rw-r--r--ctr-std/src/sys/unix/os.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/ctr-std/src/sys/unix/os.rs b/ctr-std/src/sys/unix/os.rs
index 5de756d..3a944dc 100644
--- a/ctr-std/src/sys/unix/os.rs
+++ b/ctr-std/src/sys/unix/os.rs
@@ -61,7 +61,7 @@ pub fn getcwd() -> io::Result<PathBuf> {
unsafe {
let ptr = buf.as_mut_ptr() as *mut libc::c_char;
if !libc::getcwd(ptr, buf.capacity()).is_null() {
- let len = CStr::from_ptr(buf.as_ptr() as *const libc::c_char).to_bytes().len();
+ let len = CStr::from_ptr(buf.as_ptr() as *const _).to_bytes().len();
buf.set_len(len);
buf.shrink_to_fit();
return Ok(PathBuf::from(OsString::from_vec(buf)));
@@ -85,7 +85,7 @@ pub fn chdir(p: &path::Path) -> io::Result<()> {
let p: &OsStr = p.as_ref();
let p = CString::new(p.as_bytes())?;
unsafe {
- match libc::chdir(p.as_ptr()) == (0 as c_int) {
+ match libc::chdir(p.as_ptr() as *const _) == (0 as c_int) {
true => Ok(()),
false => Err(io::Error::last_os_error()),
}