1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-23 03:05:48 +03:00
aports/community/kitty/fix-ppc64le-build-ioctl-with-musl.patch
Jakub Jirutka 5a1c87beb0 community/kitty: move from testing
I verified that Kitty works on Alpine desktop.
2021-07-28 02:37:49 +02:00

22 lines
867 B
Diff

kitty was breaking when building in ppc64le using musl, because ioctl() is defined
as ioctl(int, int) in musl and mosh is using TIOCSWINSZ macro as parameter. This was
triggering a gcc warning and make the build fail.
This patch does an explicit integer conversion in TIOCSWINSZ, as no bits get
lost.
--- a/kitty/child-monitor.c
+++ b/kitty/child-monitor.c
@@ -435,7 +435,11 @@
static inline bool
pty_resize(int fd, struct winsize *dim) {
while(true) {
+#if defined(__powerpc64__) && (!defined(__GLIBC__) && !defined(__UCLIBC__))
+ if (ioctl(fd, (int) TIOCSWINSZ, dim) == -1) {
+#else
if (ioctl(fd, TIOCSWINSZ, dim) == -1) {
+#endif
if (errno == EINTR) continue;
if (errno != EBADF && errno != ENOTTY) {
log_error("Failed to resize tty associated with fd: %d with error: %s", fd, strerror(errno));