##// END OF EJS Templates
rust-chg: have attach_io() simply take reference of AsRawFd object...
Yuya Nishihara -
r45233:cb5822e6 default
parent child Browse files
Show More
@@ -21,14 +21,12 b' use crate::procutil;'
21 21 /// 3. Client sends fds with 1-byte dummy payload in response.
22 22 /// 4. Server returns the number of the fds received.
23 23 ///
24 /// If the stderr is omitted, it will be redirected to the stdout. This
25 /// allows us to attach the pager stdin to both stdout and stderr, and
26 /// dispose of the client-side handle once attached.
24 /// The client-side fds may be dropped once duplicated to the server.
27 25 pub async fn attach_io(
28 26 proto: &mut Protocol<impl Connection + AsRawFd>,
29 stdin: impl AsRawFd,
30 stdout: impl AsRawFd,
31 stderr: Option<impl AsRawFd>,
27 stdin: &impl AsRawFd,
28 stdout: &impl AsRawFd,
29 stderr: &impl AsRawFd,
32 30 ) -> io::Result<()> {
33 31 // TODO: unindent
34 32 {
@@ -56,7 +54,7 b' pub async fn attach_io('
56 54 let sock_fd = proto.as_raw_fd();
57 55 let ifd = stdin.as_raw_fd();
58 56 let ofd = stdout.as_raw_fd();
59 let efd = stderr.as_ref().map_or(ofd, |f| f.as_raw_fd());
57 let efd = stderr.as_raw_fd();
60 58 procutil::send_raw_fds(sock_fd, &[ifd, ofd, efd])?;
61 59 }
62 60 ChannelMessage::InputRequest(..)
General Comments 0
You need to be logged in to leave comments. Login now