diff options
| author | Kunal Mohan <44079328+kunalmohan@users.noreply.github.com> | 2021-05-29 19:11:54 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-29 19:11:54 +0530 |
| commit | 906f715a527967c07308e6cbd35f8eb73d41b02c (patch) | |
| tree | 7a3a42aa89a59fb214c9ff27c92b40aa4201b028 | |
| parent | docs(changelog): Optional session name in attach #542 (diff) | |
| parent | Fix cargo fmt diff. (diff) | |
| download | sl0ppij-906f715a527967c07308e6cbd35f8eb73d41b02c.tar.gz sl0ppij-906f715a527967c07308e6cbd35f8eb73d41b02c.tar.xz sl0ppij-906f715a527967c07308e6cbd35f8eb73d41b02c.zip | |
Merge pull request #547 from riggs-/platform_build_fix
Fix build on platforms with TIOCGWINSZ / ioctl() integer type mismatch.
| -rw-r--r-- | zellij-client/src/os_input_output.rs | 8 | ||||
| -rw-r--r-- | zellij-server/src/os_input_output.rs | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/zellij-client/src/os_input_output.rs b/zellij-client/src/os_input_output.rs index 0606ae37..405422ab 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) } diff --git a/zellij-server/src/os_input_output.rs b/zellij-server/src/os_input_output.rs index 4cda73ed..a104dda2 100644 --- a/zellij-server/src/os_input_output.rs +++ b/zellij-server/src/os_input_output.rs @@ -41,7 +41,13 @@ pub(crate) fn set_terminal_size_using_fd(fd: RawFd, columns: u16, rows: u16) { ws_xpixel: 0, ws_ypixel: 0, }; - unsafe { ioctl(fd, TIOCSWINSZ, &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, TIOCSWINSZ.into(), &winsize) + }; } /// Handle some signals for the child process. This will loop until the child |
