summaryrefslogtreecommitdiffstats
path: root/zellij-client
diff options
context:
space:
mode:
authorThomas Zander <thomas.e.zander@googlemail.com>2021-05-29 14:19:40 +0200
committerThomas Zander <thomas.e.zander@googlemail.com>2021-05-29 14:19:40 +0200
commit09d12f8cbd27efa99db47dc412a09872565ecd86 (patch)
tree460018db822d96d319422941e6c1642b6ef52992 /zellij-client
parent00bbe2b0f83cb1c4f5c121bc7c10fb5d3e523bab (diff)
Fix build on platforms with TIOCGWINSZ / ioctl() integer type mismatch.
Diffstat (limited to 'zellij-client')
-rw-r--r--zellij-client/src/os_input_output.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/zellij-client/src/os_input_output.rs b/zellij-client/src/os_input_output.rs
index 0606ae374..405422abc 100644
--- a/zellij-client/src/os_input_output.rs
+++ b/zellij-client/src/os_input_output.rs
@@ -45,7 +45,13 @@ pub(crate) fn get_terminal_size_using_fd(fd: RawFd) -> PositionAndSize {
ws_ypixel: 0,
};
- unsafe { ioctl(fd, TIOCGWINSZ, &mut winsize) };
+ // TIOCGWINSZ is an u32, but the second argument to ioctl is u64 on
+ // some platforms. When checked on Linux, clippy will complain about
+ // useless conversion.
+ #[allow(clippy::useless_conversion)]
+ unsafe {
+ ioctl(fd, TIOCGWINSZ.into(), &mut winsize)
+ };
PositionAndSize::from(winsize)
}