about summary refs log tree commit diff
path: root/library/std/src/sys/stdio/uefi.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/std/src/sys/stdio/uefi.rs')
-rw-r--r--library/std/src/sys/stdio/uefi.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/library/std/src/sys/stdio/uefi.rs b/library/std/src/sys/stdio/uefi.rs
index 257e321dd03..ccd6bf658b0 100644
--- a/library/std/src/sys/stdio/uefi.rs
+++ b/library/std/src/sys/stdio/uefi.rs
@@ -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> {