summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2022-08-15 20:30:02 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-17 19:57:32 +0100
commita3e781582267b0842c04f3077ad3e561c1283d76 (patch)
tree76948ac8c43ccdae4872f3cbb032aa9198e7a3cc /meta
parent84d16bfae3f3cb9e5d07b011598d74e72ab2e8e6 (diff)
downloadpoky-a3e781582267b0842c04f3077ad3e561c1283d76.tar.gz
setserial: Fix build with clang
(From OE-Core rev: b6227069a9a5eed7b680e854703da3cea19b4e55) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-bsp/setserial/setserial/0001-setserial.c-Add-needed-system-headers-for-ioctl-and-.patch41
-rw-r--r--meta/recipes-bsp/setserial/setserial_2.17.bb3
2 files changed, 43 insertions, 1 deletions
diff --git a/meta/recipes-bsp/setserial/setserial/0001-setserial.c-Add-needed-system-headers-for-ioctl-and-.patch b/meta/recipes-bsp/setserial/setserial/0001-setserial.c-Add-needed-system-headers-for-ioctl-and-.patch
new file mode 100644
index 0000000000..10c6ae881b
--- /dev/null
+++ b/meta/recipes-bsp/setserial/setserial/0001-setserial.c-Add-needed-system-headers-for-ioctl-and-.patch
@@ -0,0 +1,41 @@
1From 9bbb342f5d9ad5dc75486fd35ada8e287ba19299 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 15 Aug 2022 13:03:17 -0700
4Subject: [PATCH] setserial.c: Add needed system headers for ioctl() and
5 close() calls
6
7Add int return type for main() function
8
9Fixes
10error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
11error: call to undeclared function 'close'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declarat
12ion]
13
14Upstream-Status: Submitted [https://sourceforge.net/p/setserial/discussion/7060/thread/95d874c12c/]
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17 setserial.c | 4 +++-
18 1 file changed, 3 insertions(+), 1 deletion(-)
19
20diff --git a/setserial.c b/setserial.c
21index bfda8fd..6a95513 100644
22--- a/setserial.c
23+++ b/setserial.c
24@@ -16,6 +16,8 @@
25 #include <termios.h>
26 #include <string.h>
27 #include <errno.h>
28+#include <unistd.h>
29+#include <sys/ioctl.h>
30
31 #ifdef HAVE_ASM_IOCTLS_H
32 #include <asm/ioctls.h>
33@@ -715,7 +717,7 @@ fprintf(stderr, "\t* port\t\tset the I/O port\n");
34 exit(1);
35 }
36
37-main(int argc, char **argv)
38+int main(int argc, char **argv)
39 {
40 int get_flag = 0, wild_intr_flag = 0;
41 int c;
diff --git a/meta/recipes-bsp/setserial/setserial_2.17.bb b/meta/recipes-bsp/setserial/setserial_2.17.bb
index 5b31cd183b..e46aeb90cb 100644
--- a/meta/recipes-bsp/setserial/setserial_2.17.bb
+++ b/meta/recipes-bsp/setserial/setserial_2.17.bb
@@ -15,7 +15,8 @@ inherit autotools-brokensep
15SRC_URI = "${SOURCEFORGE_MIRROR}/setserial/${BPN}-${PV}.tar.gz \ 15SRC_URI = "${SOURCEFORGE_MIRROR}/setserial/${BPN}-${PV}.tar.gz \
16 file://add_stdlib.patch \ 16 file://add_stdlib.patch \
17 file://ldflags.patch \ 17 file://ldflags.patch \
18 " 18 file://0001-setserial.c-Add-needed-system-headers-for-ioctl-and-.patch \
19 "
19 20
20SRC_URI[md5sum] = "c4867d72c41564318e0107745eb7a0f2" 21SRC_URI[md5sum] = "c4867d72c41564318e0107745eb7a0f2"
21SRC_URI[sha256sum] = "7e4487d320ac31558563424189435d396ddf77953bb23111a17a3d1487b5794a" 22SRC_URI[sha256sum] = "7e4487d320ac31558563424189435d396ddf77953bb23111a17a3d1487b5794a"