Skip to content

Commit af25995

Browse files
committed
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 <[email protected]>
1 parent a404015 commit af25995

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: library/std/src/sys/stdio/uefi.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,12 @@ impl io::Write for Stderr {
142142
// UTF-16 character should occupy 4 bytes at most in UTF-8
143143
pub const STDIN_BUF_SIZE: usize = 4;
144144

145-
pub fn is_ebadf(_err: &io::Error) -> bool {
146-
false
145+
pub fn is_ebadf(err: &io::Error) -> bool {
146+
if let Some(x) = err.raw_os_error() {
147+
r_efi::efi::Status::UNSUPPORTED.as_usize() == x
148+
} else {
149+
false
150+
}
147151
}
148152

149153
pub fn panic_output() -> Option<impl io::Write> {

0 commit comments

Comments
 (0)