Signed-off-by: Khem Raj <[email protected]>
---
 ...needed-system-headers-for-ioctl-and-.patch | 41 +++++++++++++++++++
 meta/recipes-bsp/setserial/setserial_2.17.bb  |  3 +-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 
meta/recipes-bsp/setserial/setserial/0001-setserial.c-Add-needed-system-headers-for-ioctl-and-.patch

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 00000000000..10c6ae881be
--- /dev/null
+++ 
b/meta/recipes-bsp/setserial/setserial/0001-setserial.c-Add-needed-system-headers-for-ioctl-and-.patch
@@ -0,0 +1,41 @@
+From 9bbb342f5d9ad5dc75486fd35ada8e287ba19299 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Mon, 15 Aug 2022 13:03:17 -0700
+Subject: [PATCH] setserial.c: Add needed system headers for ioctl() and
+ close() calls
+
+Add int return type for main() function
+
+Fixes
+error: type specifier missing, defaults to 'int'; ISO C99 and later do not 
support implicit int [-Wimplicit-int]
+error: call to undeclared function 'close'; ISO C99 and later do not support 
implicit function declarations [-Wimplicit-function-declarat
+ion]
+
+Upstream-Status: Submitted 
[https://sourceforge.net/p/setserial/discussion/7060/thread/95d874c12c/]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ setserial.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/setserial.c b/setserial.c
+index bfda8fd..6a95513 100644
+--- a/setserial.c
++++ b/setserial.c
+@@ -16,6 +16,8 @@
+ #include <termios.h>
+ #include <string.h>
+ #include <errno.h>
++#include <unistd.h>
++#include <sys/ioctl.h>
+ 
+ #ifdef HAVE_ASM_IOCTLS_H
+ #include <asm/ioctls.h>
+@@ -715,7 +717,7 @@ fprintf(stderr, "\t* port\t\tset the I/O port\n");
+       exit(1);
+ }
+ 
+-main(int argc, char **argv)
++int main(int argc, char **argv)
+ {
+       int     get_flag = 0, wild_intr_flag = 0;
+       int     c;
diff --git a/meta/recipes-bsp/setserial/setserial_2.17.bb 
b/meta/recipes-bsp/setserial/setserial_2.17.bb
index 5b31cd183b5..e46aeb90cb7 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
 SRC_URI = "${SOURCEFORGE_MIRROR}/setserial/${BPN}-${PV}.tar.gz \
            file://add_stdlib.patch \
            file://ldflags.patch \
-          "
+           
file://0001-setserial.c-Add-needed-system-headers-for-ioctl-and-.patch \
+           "
 
 SRC_URI[md5sum] = "c4867d72c41564318e0107745eb7a0f2"
 SRC_URI[sha256sum] = 
"7e4487d320ac31558563424189435d396ddf77953bb23111a17a3d1487b5794a"
-- 
2.37.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#169417): 
https://lists.openembedded.org/g/openembedded-core/message/169417
Mute This Topic: https://lists.openembedded.org/mt/93052349/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to