Switch almost all of Pal to Rusty error handling.
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user