process: Implement AsRawFd for ChildStd* structs

This commit is contained in:
Yuya Nishihara
2019-06-24 16:57:17 -07:00
committed by Ivan Petkov
parent 3b43262a10
commit e0e9594f71
+24
View File
@@ -619,3 +619,27 @@ impl Read for ChildStderr {
impl AsyncRead for ChildStderr {
}
#[cfg(unix)]
mod sys {
use std::os::unix::io::{AsRawFd, RawFd};
use super::{ChildStdin, ChildStdout, ChildStderr};
impl AsRawFd for ChildStdin {
fn as_raw_fd(&self) -> RawFd {
self.inner.get_ref().as_raw_fd()
}
}
impl AsRawFd for ChildStdout {
fn as_raw_fd(&self) -> RawFd {
self.inner.get_ref().as_raw_fd()
}
}
impl AsRawFd for ChildStderr {
fn as_raw_fd(&self) -> RawFd {
self.inner.get_ref().as_raw_fd()
}
}
}