1
0
Fork 0
forked from wry/wry

all: simplify handling of Errno values

This commit is contained in:
Julian Orth 2026-04-02 18:34:12 +02:00
parent 9c605df692
commit 34914eccb0
58 changed files with 443 additions and 464 deletions

View file

@ -20,8 +20,12 @@ use {
theme::Color,
udmabuf::UdmabufHolder,
utils::{
clonecell::CloneCell, double_buffered::DoubleBuffered, errorfmt::ErrorFmt,
on_drop_event::OnDropEvent, oserror::OsError, page_size::page_size,
clonecell::CloneCell,
double_buffered::DoubleBuffered,
errorfmt::ErrorFmt,
on_drop_event::OnDropEvent,
oserror::{OsError, OsErrorExt2},
page_size::page_size,
},
},
std::{
@ -691,9 +695,7 @@ impl Memfd {
let Ok(isize) = off_t::try_from(size) else {
return Err(TextError::SizeOverflow);
};
if let Err(e) = ftruncate(self.fd.raw(), isize) {
return Err(TextError::ResizeMemfd(e.into()));
}
ftruncate(self.fd.raw(), isize).map_os_err(TextError::ResizeMemfd)?;
let old_ptr = self.mapping.load(Relaxed);
let new_ptr = if old_ptr.is_null() {
unsafe {