Fix build on platforms with TIOCGWINSZ / ioctl() integer type mismatch.
This commit is contained in:
parent
00bbe2b0f8
commit
09d12f8cbd
2 changed files with 12 additions and 2 deletions
|
|
@ -45,7 +45,13 @@ pub(crate) fn get_terminal_size_using_fd(fd: RawFd) -> PositionAndSize {
|
||||||
ws_ypixel: 0,
|
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)
|
PositionAndSize::from(winsize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,11 @@ pub(crate) fn set_terminal_size_using_fd(fd: RawFd, columns: u16, rows: u16) {
|
||||||
ws_xpixel: 0,
|
ws_xpixel: 0,
|
||||||
ws_ypixel: 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
|
/// Handle some signals for the child process. This will loop until the child
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue