mirror of
https://github.com/NotAShelf/microfetch.git
synced 2025-12-14 00:21:00 +00:00
fix: handle partial writes from libc::write
This commit is contained in:
parent
9da87b933d
commit
f0cf18dba7
1 changed files with 3 additions and 0 deletions
|
|
@ -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(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue