std: sys: stdio: uefi: Tread UNSUPPORTED Status as read(0)

Allows implementing Stdio::Null for Command in a deterministic manner.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
This commit is contained in:
Ayush Singh 2025-04-13 20:11:44 +05:30
parent a404015775
commit af25995d11
No known key found for this signature in database
GPG Key ID: 05CEF5C789E55A74

View File

@ -142,8 +142,12 @@ impl io::Write for Stderr {
// UTF-16 character should occupy 4 bytes at most in UTF-8
pub const STDIN_BUF_SIZE: usize = 4;
pub fn is_ebadf(_err: &io::Error) -> bool {
false
pub fn is_ebadf(err: &io::Error) -> bool {
if let Some(x) = err.raw_os_error() {
r_efi::efi::Status::UNSUPPORTED.as_usize() == x
} else {
false
}
}
pub fn panic_output() -> Option<impl io::Write> {