about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stdio.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/sys/unix/stdio.rs')
-rw-r--r--src/libstd/sys/unix/stdio.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstd/sys/unix/stdio.rs b/src/libstd/sys/unix/stdio.rs
index 7a8fe25d98e..e9b3d4affc7 100644
--- a/src/libstd/sys/unix/stdio.rs
+++ b/src/libstd/sys/unix/stdio.rs
@@ -70,5 +70,8 @@ impl io::Write for Stderr {
     }
 }
 
-pub const EBADF_ERR: i32 = ::libc::EBADF as i32;
+pub fn is_ebadf(err: &io::Error) -> bool {
+    err.raw_os_error() == Some(libc::EBADF as i32)
+}
+
 pub const STDIN_BUF_SIZE: usize = ::sys_common::io::DEFAULT_BUF_SIZE;