Remove c_str functions, replace with CStr

This commit is contained in:
Jeremy Soller
2018-09-24 21:08:29 -06:00
parent ef9fee5a2b
commit 7f14fcdee0
8 changed files with 29 additions and 62 deletions
+3 -2
View File
@@ -141,8 +141,9 @@ impl Pal for Sys {
}
fn fstat(fildes: c_int, buf: *mut stat) -> c_int {
let empty_cstr: *const c_char = unsafe { super::cstr_from_bytes_with_nul_unchecked(b"\0") };
e(unsafe { syscall!(NEWFSTATAT, fildes, empty_cstr, buf, AT_EMPTY_PATH) }) as c_int
let empty = b"\0";
let empty_ptr = empty.as_ptr() as *const c_char;
e(unsafe { syscall!(NEWFSTATAT, fildes, empty_ptr, buf, AT_EMPTY_PATH) }) as c_int
}
fn fcntl(fildes: c_int, cmd: c_int, arg: c_int) -> c_int {