blob: 19f0ae7f211a7e990637b58e09b077152c5cb250 [file] [log] [blame]
Andrew Geissler87f5cff2022-09-30 13:13:31 -05001From 269f18d5e6698fdd34fec2798f10c6fe072f3cd5 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 1 Sep 2022 23:36:52 -0700
4Subject: [PATCH] Fix signature of main function
5
6Clang-15 errors out otherewise.
7Include needed headers for missing functions
8
9Upstream-Status:Pending
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 src/chkshsgr.c | 2 +-
13 src/tai64n.c | 2 +-
14 src/tai64nlocal.c | 2 +-
15 src/trycpp.c | 5 +++--
16 src/tryflock.c | 4 ++--
17 src/trymkffo.c | 2 +-
18 src/trypoll.c | 3 ++-
19 src/trysgact.c | 4 ++--
20 src/trysgprm.c | 4 ++--
21 src/tryshsgr.c | 3 ++-
22 src/tryulong64.c | 4 ++--
23 src/trywaitp.c | 4 ++--
24 src/x86cpuid.c | 2 +-
25 13 files changed, 22 insertions(+), 19 deletions(-)
26
27diff --git a/src/chkshsgr.c b/src/chkshsgr.c
28index 038afe9..9547a4c 100644
29--- a/src/chkshsgr.c
30+++ b/src/chkshsgr.c
31@@ -5,7 +5,7 @@
32 #include <grp.h>
33 #include <unistd.h>
34
35-int main()
36+int main(int argc, char *argv[])
37 {
38 gid_t x[4];
39
40diff --git a/src/tai64n.c b/src/tai64n.c
41index 17bdb82..7096ab3 100644
42--- a/src/tai64n.c
43+++ b/src/tai64n.c
44@@ -27,7 +27,7 @@ buffer in = BUFFER_INIT(myread,0,inbuf,sizeof inbuf);
45
46 char stamp[TIMESTAMP + 1];
47
48-int main()
49+int main(int argc, char *argv[])
50 {
51 char ch;
52
53diff --git a/src/tai64nlocal.c b/src/tai64nlocal.c
54index ce16ad8..2435737 100644
55--- a/src/tai64nlocal.c
56+++ b/src/tai64nlocal.c
57@@ -28,7 +28,7 @@ unsigned long nanosecs;
58 unsigned long u;
59 struct tm *t;
60
61-int main()
62+int main(int argc, char *argv[])
63 {
64 char ch;
65
66diff --git a/src/trycpp.c b/src/trycpp.c
67index e4503d4..d96c955 100644
68--- a/src/trycpp.c
69+++ b/src/trycpp.c
70@@ -1,6 +1,7 @@
71 /* Public domain. */
72-
73-int main()
74+#include <stdio.h>
75+#include <stdlib.h>
76+int main(int argc, char *argv[])
77 {
78 #ifdef NeXT
79 printf("nextstep\n"); exit(0);
80diff --git a/src/tryflock.c b/src/tryflock.c
81index a82ffc2..5ca97d3 100644
82--- a/src/tryflock.c
83+++ b/src/tryflock.c
84@@ -3,8 +3,8 @@
85 #include <sys/types.h>
86 #include <sys/file.h>
87 #include <fcntl.h>
88-
89-main()
90+void
91+main(int argc, char *argv[])
92 {
93 flock(0,LOCK_EX | LOCK_UN | LOCK_NB);
94 }
95diff --git a/src/trymkffo.c b/src/trymkffo.c
96index 9356342..f92414a 100644
97--- a/src/trymkffo.c
98+++ b/src/trymkffo.c
99@@ -3,7 +3,7 @@
100 #include <sys/types.h>
101 #include <sys/stat.h>
102
103-void main()
104+void main(int argc, char *argv[])
105 {
106 mkfifo("temp-trymkffo",0);
107 }
108diff --git a/src/trypoll.c b/src/trypoll.c
109index 6506617..cb888cc 100644
110--- a/src/trypoll.c
111+++ b/src/trypoll.c
112@@ -3,8 +3,9 @@
113 #include <sys/types.h>
114 #include <fcntl.h>
115 #include <poll.h>
116+#include <unistd.h>
117
118-int main()
119+int main(int argc, char *argv[])
120 {
121 struct pollfd x;
122
123diff --git a/src/trysgact.c b/src/trysgact.c
124index e264ef2..25da013 100644
125--- a/src/trysgact.c
126+++ b/src/trysgact.c
127@@ -1,8 +1,8 @@
128 /* Public domain. */
129
130 #include <signal.h>
131-
132-main()
133+void
134+main(int argc, char *argv[])
135 {
136 struct sigaction sa;
137 sa.sa_handler = 0;
138diff --git a/src/trysgprm.c b/src/trysgprm.c
139index a46c82c..5a9491c 100644
140--- a/src/trysgprm.c
141+++ b/src/trysgprm.c
142@@ -1,8 +1,8 @@
143 /* Public domain. */
144
145 #include <signal.h>
146-
147-main()
148+void
149+main(int argc, char *argv[])
150 {
151 sigset_t ss;
152
153diff --git a/src/tryshsgr.c b/src/tryshsgr.c
154index c5ed6d6..d111e40 100644
155--- a/src/tryshsgr.c
156+++ b/src/tryshsgr.c
157@@ -1,6 +1,7 @@
158 /* Public domain. */
159
160-int main()
161+#include <unistd.h>
162+int main(int argc, char *argv[])
163 {
164 short x[4];
165
166diff --git a/src/tryulong64.c b/src/tryulong64.c
167index 003548a..20a3a40 100644
168--- a/src/tryulong64.c
169+++ b/src/tryulong64.c
170@@ -1,6 +1,6 @@
171 /* Public domain. */
172-
173-int main()
174+#include <unistd.h>
175+int main(int argc, char *argv[])
176 {
177 unsigned long u;
178 u = 1;
179diff --git a/src/trywaitp.c b/src/trywaitp.c
180index 319b81f..90bc5aa 100644
181--- a/src/trywaitp.c
182+++ b/src/trywaitp.c
183@@ -2,8 +2,8 @@
184
185 #include <sys/types.h>
186 #include <sys/wait.h>
187-
188-main()
189+void
190+main(int argc, char *argv[])
191 {
192 waitpid(0,0,0);
193 }
194diff --git a/src/x86cpuid.c b/src/x86cpuid.c
195index f81c593..1cb1ea6 100644
196--- a/src/x86cpuid.c
197+++ b/src/x86cpuid.c
198@@ -7,7 +7,7 @@ void nope()
199 exit(1);
200 }
201
202-int main()
203+int main(int argc, char *argv[])
204 {
205 unsigned long x[4];
206 unsigned long y[4];
207--
2082.37.3
209