mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
Cast libc::STDIN_FILENO
to RawFd
.
WASI's `RawFd` is a `u32`, while `libc` uses `c_int`.
This commit is contained in:
parent
132ec261b0
commit
9ce567efc2
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user