From ec2c270a38692a7feaf26f6a4a97f7ded4e7e6c9 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 2 Mar 2019 12:25:47 -0800 Subject: [PATCH] remove non-blocking bit, allow dead_code attrs for helpers --- src/mux/mod.rs | 1 + src/pty/unix.rs | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mux/mod.rs b/src/mux/mod.rs index 660171067..c8299114a 100644 --- a/src/mux/mod.rs +++ b/src/mux/mod.rs @@ -124,6 +124,7 @@ impl Mux { Ok(()) } + #[allow(dead_code)] pub fn is_empty(&self) -> bool { self.tabs.borrow().is_empty() } diff --git a/src/pty/unix.rs b/src/pty/unix.rs index 1fa44530d..e29c1a083 100644 --- a/src/pty/unix.rs +++ b/src/pty/unix.rs @@ -116,6 +116,7 @@ fn cloexec(fd: RawFd) -> Result<(), Error> { Ok(()) } +#[allow(dead_code)] fn clear_nonblocking(fd: RawFd) -> Result<(), Error> { let flags = unsafe { libc::fcntl(fd, libc::F_GETFL, 0) }; if flags == -1 { @@ -134,6 +135,7 @@ fn clear_nonblocking(fd: RawFd) -> Result<(), Error> { Ok(()) } +#[allow(dead_code)] fn set_nonblocking(fd: RawFd) -> Result<(), Error> { let flags = unsafe { libc::fcntl(fd, libc::F_GETFL, 0) }; if flags == -1 { @@ -201,8 +203,6 @@ pub fn openpty( cloexec(master.fd.as_raw_fd())?; cloexec(slave.fd.as_raw_fd())?; - set_nonblocking(master.fd.as_raw_fd())?; // FIXME: do we need this any more? - Ok((master, slave)) } @@ -319,7 +319,6 @@ impl MasterPty { pub fn try_clone_reader(&self) -> Result, Error> { let fd = self.fd.try_clone()?; - clear_nonblocking(fd.as_raw_fd())?; Ok(Box::new(fd)) } }