summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstefanf <stefanf@FreeBSD.org>2005-08-13 08:38:02 +0000
committerstefanf <stefanf@FreeBSD.org>2005-08-13 08:38:02 +0000
commit810123c2f688458c9677d8cd08da90460f18926c (patch)
treea3bce55217355dd946367ab1553e47f32291e8e7
parent4aaeb3754a665024738d5be87c19f00e4cc3ecdc (diff)
downloadFreeBSD-src-810123c2f688458c9677d8cd08da90460f18926c.zip
FreeBSD-src-810123c2f688458c9677d8cd08da90460f18926c.tar.gz
- Provide all initialisers for a struct event.
- Include init.h in the generated init.c. - Generate prototypes and put the brace on the next line.
-rw-r--r--bin/sh/mkinit.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/sh/mkinit.c b/bin/sh/mkinit.c
index 27c9710..b158b5f 100644
--- a/bin/sh/mkinit.c
+++ b/bin/sh/mkinit.c
@@ -133,10 +133,10 @@ char shellproc[] = "\
struct event event[] = {
- {"INIT", "init", init},
- {"RESET", "reset", reset},
- {"SHELLPROC", "initshellproc", shellproc},
- {NULL, NULL}
+ { "INIT", "init", init, { NULL, 0, NULL, NULL } },
+ { "RESET", "reset", reset, { NULL, 0, NULL, NULL } },
+ { "SHELLPROC", "initshellproc", shellproc, { NULL, 0, NULL, NULL } },
+ { NULL, NULL, NULL, { NULL, 0, NULL, NULL } }
};
@@ -172,6 +172,7 @@ main(int argc __unused, char *argv[])
header_files[0] = "\"shell.h\"";
header_files[1] = "\"mystring.h\"";
+ header_files[2] = "\"init.h\"";
for (ap = argv + 1 ; *ap ; ap++)
readfile(*ap);
output();
@@ -391,7 +392,7 @@ output(void)
for (ep = event ; ep->name ; ep++) {
fputs("\n\n\n", fp);
fputs(ep->comment, fp);
- fprintf(fp, "\nvoid\n%s() {\n", ep->routine);
+ fprintf(fp, "\nvoid\n%s(void)\n{\n", ep->routine);
writetext(&ep->code, fp);
fprintf(fp, "}\n");
}
OpenPOWER on IntegriCloud