CI: kernel: check if patch are refreshed for each target
[openwrt/openwrt.git] / package / boot / uboot-mvebu / patches / 0001-tools-termios_linux.h-Fix-compilation-on-non-glibc-s.patch
1 From 82a6da13c3a113eefdb378ff53635f32a6184d6f Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
3 Date: Thu, 8 Sep 2022 16:59:36 +0200
4 Subject: [PATCH] tools: termios_linux.h: Fix compilation on non-glibc systems
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 TCGETS2 is defined in header file asm/ioctls.h provided by linux kernel.
10 On glib systems it is automatically included by some other glibc include
11 header file and therefore TCGETS2 is present in termios_linux.h when
12 linux kernel provides it.
13
14 On non-glibc systems (e.g. musl) asm/ioctls.h is not automatically included
15 which results in the strange error that BOTHER is supported, TCGETS2 not
16 defined and struct termios does not provide c_ispeed member.
17
18 tools/kwboot.c: In function 'kwboot_tty_change_baudrate':
19 tools/kwboot.c:662:6: error: 'struct termios' has no member named 'c_ospeed'
20 662 | tio.c_ospeed = tio.c_ispeed = baudrate;
21 | ^
22
23 Fix this issue by explicitly including asm/ioctls.h file which provides
24 TCGETS2 macro (if supported on selected architecture) to not depending on
25 glibc auto-include behavior and because termios_linux.h requires it.
26
27 With this change it is possible compile kwboot with musl libc.
28
29 Reported-by: Michal Vasilek <michal.vasilek@nic.cz>
30 Signed-off-by: Pali Rohár <pali@kernel.org>
31 ---
32 tools/termios_linux.h | 1 +
33 1 file changed, 1 insertion(+)
34
35 --- a/tools/termios_linux.h
36 +++ b/tools/termios_linux.h
37 @@ -29,6 +29,7 @@
38 #include <errno.h>
39 #include <sys/ioctl.h>
40 #include <sys/types.h>
41 +#include <asm/ioctls.h>
42 #include <asm/termbits.h>
43
44 #if defined(BOTHER) && defined(TCGETS2)