fix: handle partial writes from libc::write

This commit is contained in:
Uzair Aftab 2025-12-09 19:36:29 +01:00
commit f0cf18dba7
No known key found for this signature in database

View file

@ -107,5 +107,8 @@ fn print_system_info(
if written < 0 { if written < 0 {
return Err(io::Error::last_os_error().into()); return Err(io::Error::last_os_error().into());
} }
if written as usize != len {
return Err(io::Error::new(io::ErrorKind::WriteZero, "partial write to stdout").into());
}
Ok(()) Ok(())
} }