diff options
author | Roberto Oliveira <robertoguimaraes8@gmail.com> | 2017-04-04 16:46:50 +0000 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-04-04 22:27:40 +0200 |
commit | 17ee07c9a8e698ee9c06a435eddcccae27ae1bbd (patch) | |
tree | a3939b02275e56e5df7c373f41b90f2716789301 /main/mosh/fix-ppc64le-build-with-musl.patch | |
parent | 810a128f4c1ea41d37f7887c2641faf0c0c5aa25 (diff) | |
download | aports-17ee07c9a8e698ee9c06a435eddcccae27ae1bbd.tar.bz2 aports-17ee07c9a8e698ee9c06a435eddcccae27ae1bbd.tar.xz |
main/mosh: fix build with musl on ppc64le
mosh 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.
Diffstat (limited to 'main/mosh/fix-ppc64le-build-with-musl.patch')
-rw-r--r-- | main/mosh/fix-ppc64le-build-with-musl.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/main/mosh/fix-ppc64le-build-with-musl.patch b/main/mosh/fix-ppc64le-build-with-musl.patch new file mode 100644 index 0000000000..8d918a963a --- /dev/null +++ b/main/mosh/fix-ppc64le-build-with-musl.patch @@ -0,0 +1,53 @@ +From: Roberto Oliveira <robertoguimaraes8@gmail.com> +Date: Tue, 4 Apr 2017 16:46:50 +0000 +Subject: [PATCH] Fix build with musl on ppc64le + +mosh 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/src/frontend/mosh-server.cc ++++ b/src/frontend/mosh-server.cc +@@ -714,7 +714,12 @@ + } + window_size.ws_col = res->width; + window_size.ws_row = res->height; +- if ( ioctl( host_fd, TIOCSWINSZ, &window_size ) < 0 ) { ++ ++ #if defined(__powerpc64__) && (!defined(__GLIBC__) && !defined(__UCLIBC__)) ++ if ( ioctl( host_fd, (int) TIOCSWINSZ, &window_size ) < 0 ) { ++ #else ++ if ( ioctl( host_fd, TIOCSWINSZ, &window_size ) < 0 ) { ++ #endif + perror( "ioctl TIOCSWINSZ" ); + network.start_shutdown(); + } +--- a/src/examples/termemu.cc ++++ a/src/examples/termemu.cc +@@ -226,7 +226,11 @@ + } + + /* tell child process */ ++ #if defined(__powerpc64__) && (!defined(__GLIBC__) && !defined(__UCLIBC__)) ++ if ( ioctl( fd, (int) TIOCSWINSZ, &window_size ) < 0 ) { ++ #else + if ( ioctl( fd, TIOCSWINSZ, &window_size ) < 0 ) { ++ #endif + perror( "ioctl TIOCSWINSZ" ); + return; + } +@@ -306,7 +310,11 @@ + complete.act( &r ); + + /* tell child process */ ++ #if defined(__powerpc64__) && (!defined(__GLIBC__) && !defined(__UCLIBC__)) ++ if ( ioctl( fd, (int) TIOCSWINSZ, &window_size ) < 0 ) { ++ #else + if ( ioctl( fd, TIOCSWINSZ, &window_size ) < 0 ) { ++ #endif + perror( "ioctl TIOCSWINSZ" ); + return; + } |