aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/sys.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/sys.rs b/src/sys.rs
index 244a43d..272255f 100644
--- a/src/sys.rs
+++ b/src/sys.rs
@@ -102,7 +102,10 @@ impl Pts {
let pts_fd = self.0.as_raw_fd();
move || {
nix::unistd::setsid()?;
- set_controlling_terminal(pts_fd)?;
+ // Safety: Pts is required to contain a valid file descriptor
+ unsafe {
+ set_controlling_terminal_unsafe(pts_fd, std::ptr::null())
+ }?;
Ok(())
}
}
@@ -120,12 +123,6 @@ impl std::os::unix::io::AsRawFd for Pts {
}
}
-fn set_controlling_terminal(fd: std::os::unix::io::RawFd) -> nix::Result<()> {
- // Safety: Pts is required to contain a valid file descriptor
- unsafe { set_controlling_terminal_unsafe(fd, std::ptr::null()) }
- .map(|_| ())
-}
-
nix::ioctl_write_ptr_bad!(
set_term_size_unsafe,
libc::TIOCSWINSZ,