Switch almost all of Pal to Rusty error handling.

This commit is contained in:
4lDO2
2024-09-27 10:19:44 +02:00
parent 549bdc5c72
commit 313b32c815
20 changed files with 338 additions and 301 deletions
+4 -1
View File
@@ -2,6 +2,7 @@
use crate::{
c_str::CStr,
error::ResultExt,
header::time::timespec,
platform::{types::*, Pal, PalSignal, Sys},
};
@@ -52,7 +53,7 @@ pub unsafe extern "C" fn setitimer(
#[no_mangle]
pub unsafe extern "C" fn gettimeofday(tp: *mut timeval, tzp: *mut timezone) -> c_int {
Sys::gettimeofday(tp, tzp)
Sys::gettimeofday(tp, tzp).map(|()| 0).or_minus_one_errno()
}
#[no_mangle]
@@ -77,4 +78,6 @@ pub unsafe extern "C" fn utimes(path: *const c_char, times: *const timeval) -> c
.as_ptr()
};
Sys::utimens(path, times_spec)
.map(|()| 0)
.or_minus_one_errno()
}