blob: 10c6ae881bedc47f68d1073f6e93b09c3eb2b069 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001From 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;