aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tty.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/tty.rs b/src/tty.rs
index aea2691f..21c9659d 100644
--- a/src/tty.rs
+++ b/src/tty.rs
@@ -113,10 +113,12 @@ fn openpty(rows: u8, cols: u8) -> (c_int, c_int) {
/// Really only needed on BSD, but should be fine elsewhere
fn set_controlling_terminal(fd: c_int) {
let res = unsafe {
- // Cross platform issue because on linux this is u64 as u64 (does nothing)
- // But on macos this is u32 as u64, asking for u64::from(u32)
+ // TIOSCTTY changes based on platform and the `ioctl` call is different
+ // based on architecture (32/64). So a generic cast is used to make sure
+ // there are no issues. To allow such a generic cast the clippy warning
+ // is disabled.
#[cfg_attr(feature = "clippy", allow(cast_lossless))]
- libc::ioctl(fd, TIOCSCTTY as u64, 0)
+ libc::ioctl(fd, TIOCSCTTY as _, 0)
};
if res < 0 {