Convert more Pal methods to Result.

This commit is contained in:
4lDO2
2024-09-22 20:03:10 +02:00
parent 6e5959b3fa
commit 4b687c25d2
14 changed files with 330 additions and 348 deletions
+2 -2
View File
@@ -682,7 +682,7 @@ pub unsafe fn fseek_locked(stream: &mut FILE, mut off: off_t, whence: c_int) ->
return -1;
}
let err = Sys::lseek(*stream.file, off, whence);
let err = Sys::lseek(*stream.file, off, whence).or_minus_one_errno();
if err < 0 {
return err as c_int;
}
@@ -713,7 +713,7 @@ pub unsafe extern "C" fn ftello(stream: *mut FILE) -> off_t {
ftell_locked(&mut *stream)
}
pub unsafe extern "C" fn ftell_locked(stream: &mut FILE) -> off_t {
let pos = Sys::lseek(*stream.file, 0, SEEK_CUR);
let pos = Sys::lseek(*stream.file, 0, SEEK_CUR).or_minus_one_errno();
if pos < 0 {
return -1;
}