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
+5 -2
View File
@@ -1,6 +1,9 @@
//! sys/file.h implementation
use crate::platform::{types::*, Pal, Sys};
use crate::{
error::ResultExt,
platform::{types::*, Pal, Sys},
};
pub const LOCK_SH: usize = 1;
pub const LOCK_EX: usize = 2;
@@ -13,5 +16,5 @@ pub const L_XTND: usize = 2;
#[no_mangle]
pub extern "C" fn flock(fd: c_int, operation: c_int) -> c_int {
Sys::flock(fd, operation)
Sys::flock(fd, operation).map(|()| 0).or_minus_one_errno()
}