aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Duerr <chrisduerr@users.noreply.github.com>2018-01-08 22:49:01 +0000
committerGitHub <noreply@github.com>2018-01-08 22:49:01 +0000
commit02953c28127ece6a919e43f607ff5dbd442c6de0 (patch)
tree296163375ea5d6d187fdc15ed99dd27b8ce85d8e
parentbd9123e7df4436049866a361e2751b98056c25f1 (diff)
downloadalacritty-02953c28127ece6a919e43f607ff5dbd442c6de0.tar.gz
alacritty-02953c28127ece6a919e43f607ff5dbd442c6de0.zip
Fix `ioctl` call failing on 32 bit architecture (#1011)
-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 {