remove non-blocking bit, allow dead_code attrs for helpers
This commit is contained in:
1 parent
871ce9a6c2
commit
ec2c270a38
2 files changed
+3
-3
No files matched your search
@@ -124,6 +124,7 @@ impl Mux {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.tabs.borrow().is_empty()
|
||||
}
|
||||
|
||||
+2
-3
@@ -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<Box<std::io::Read + Send>, Error> {
|
||||
let fd = self.fd.try_clone()?;
|
||||
clear_nonblocking(fd.as_raw_fd())?;
|
||||
Ok(Box::new(fd))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user