Cast libc::STDIN_FILENO to RawFd.

WASI's `RawFd` is a `u32`, while `libc` uses `c_int`.
This commit is contained in:
Dan Gohman 2021-02-24 10:35:40 -08:00
parent 132ec261b0
commit 9ce567efc2

View File

@ -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
}
}