From 9ce567efc20e3bfc8409ae92af74ebfc53b83aa8 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 24 Feb 2021 10:35:40 -0800 Subject: [PATCH] Cast `libc::STDIN_FILENO` to `RawFd`. WASI's `RawFd` is a `u32`, while `libc` uses `c_int`. --- library/std/src/sys/wasi/ext/io.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/std/src/sys/wasi/ext/io.rs b/library/std/src/sys/wasi/ext/io.rs index d0edfa9f35f..3c480aa8e19 100644 --- a/library/std/src/sys/wasi/ext/io.rs +++ b/library/std/src/sys/wasi/ext/io.rs @@ -145,36 +145,36 @@ impl IntoRawFd for fs::File { impl AsRawFd for io::Stdin { fn as_raw_fd(&self) -> RawFd { - libc::STDIN_FILENO + libc::STDIN_FILENO as RawFd } } impl AsRawFd for io::Stdout { fn as_raw_fd(&self) -> RawFd { - libc::STDOUT_FILENO + libc::STDOUT_FILENO as RawFd } } impl AsRawFd for io::Stderr { fn as_raw_fd(&self) -> RawFd { - libc::STDERR_FILENO + libc::STDERR_FILENO as RawFd } } impl<'a> AsRawFd for io::StdinLock<'a> { fn as_raw_fd(&self) -> RawFd { - libc::STDIN_FILENO + libc::STDIN_FILENO as RawFd } } impl<'a> AsRawFd for io::StdoutLock<'a> { fn as_raw_fd(&self) -> RawFd { - libc::STDOUT_FILENO + libc::STDOUT_FILENO as RawFd } } impl<'a> AsRawFd for io::StderrLock<'a> { fn as_raw_fd(&self) -> RawFd { - libc::STDERR_FILENO + libc::STDERR_FILENO as RawFd } }