summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/mkoptions.c
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-09-15 06:37:10 +0000
committercharnier <charnier@FreeBSD.org>1997-09-15 06:37:10 +0000
commitb8c46235c5b5fcd433f224674a9be99e69acc8ee (patch)
tree1007228a0adbd7ca7cc3ddf18308603f1351f20e /usr.sbin/config/mkoptions.c
parent130c7bee5c488aa3c51a2fbd042f556666891880 (diff)
downloadFreeBSD-src-b8c46235c5b5fcd433f224674a9be99e69acc8ee.zip
FreeBSD-src-b8c46235c5b5fcd433f224674a9be99e69acc8ee.tar.gz
Use err(3), add usage(). -Wall clean.
Diffstat (limited to 'usr.sbin/config/mkoptions.c')
-rw-r--r--usr.sbin/config/mkoptions.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/usr.sbin/config/mkoptions.c b/usr.sbin/config/mkoptions.c
index aea47b6..16a2d8f 100644
--- a/usr.sbin/config/mkoptions.c
+++ b/usr.sbin/config/mkoptions.c
@@ -33,30 +33,37 @@
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)mkheaders.c 8.1 (Berkeley) 6/6/93";
+#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
/*
* Make all the .h files for the optional entries
*/
+#include <ctype.h>
+#include <err.h>
#include <stdio.h>
#include <string.h>
-#include <ctype.h>
#include "config.h"
#include "y.tab.h"
#define ns(s) strdup(s)
static char *lower __P((char *));
+void read_options __P((void));
+void do_option __P((char *));
+void
options()
{
struct opt_list *ol;
/* fake the cpu types as options */
/* Please forgive me for this hack.. :-) */
- struct opt *op;
struct cputype *cp;
for (cp = cputype; cp; cp = cp->cpu_next) {
@@ -77,6 +84,7 @@ options()
* Generate an <options>.h file
*/
+void
do_option(name)
char *name;
{
@@ -105,10 +113,8 @@ do_option(name)
inf = fopen(file, "r");
if (inf == 0) {
outf = fopen(file, "w");
- if (outf == 0) {
- perror(file);
- exit(1);
- }
+ if (outf == 0)
+ err(1, "%s", file);
/* was the option in the config file? */
if (value) {
@@ -177,10 +183,8 @@ do_option(name)
}
outf = fopen(file, "w");
- if (outf == 0) {
- perror(file);
- exit(1);
- }
+ if (outf == 0)
+ err(1, "%s", file);
for (op = op_head; op != NULL; op = topp) {
/* was the option in the config file? */
if (op->op_value) {
@@ -223,6 +227,7 @@ tooption(name)
/*
* read the options and options.<machine> files
*/
+void
read_options()
{
FILE *fp;
OpenPOWER on IntegriCloud