summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/config.y
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/config.y
parent130c7bee5c488aa3c51a2fbd042f556666891880 (diff)
downloadFreeBSD-src-b8c46235c5b5fcd433f224674a9be99e69acc8ee.zip
FreeBSD-src-b8c46235c5b5fcd433f224674a9be99e69acc8ee.tar.gz
Use err(3), add usage(). -Wall clean.
Diffstat (limited to 'usr.sbin/config/config.y')
-rw-r--r--usr.sbin/config/config.y40
1 files changed, 26 insertions, 14 deletions
diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y
index cbf9ea5..2e698c1 100644
--- a/usr.sbin/config/config.y
+++ b/usr.sbin/config/config.y
@@ -117,8 +117,8 @@
#include <sys/diskslice.h>
#include <ctype.h>
-#include <stdio.h>
#include <err.h>
+#include <stdio.h>
#include <string.h>
struct device cur;
@@ -126,6 +126,12 @@ struct device *curp = 0;
#define ns(s) strdup(s)
+void init_dev __P((struct device *));
+int finddev __P((dev_t));
+void deverror __P((char *, char *));
+int alreadychecked __P((dev_t, dev_t[], dev_t *));
+void verifycomp __P((struct file_list *));
+
%}
%%
Configuration:
@@ -398,7 +404,7 @@ Option:
op->op_next = opt;
op->op_value = 0;
opt = op;
- if (s = strchr(op->op_name, '=')) {
+ if ((s = strchr(op->op_name, '='))) {
/* AARGH!!!! Old-style bogon */
*s = '\0';
op->op_value = ns(s + 1);
@@ -652,16 +658,17 @@ Id_list:
%%
+void
yyerror(s)
char *s;
{
-
- fprintf(stderr, "config: line %d: %s\n", yyline + 1, s);
+ warnx("line %d: %s", yyline + 1, s);
}
/*
* add a device to the list of devices
*/
+void
newdev(dp)
register struct device *dp;
{
@@ -681,6 +688,7 @@ newdev(dp)
/*
* note that a configuration should be made
*/
+void
mkconf(sysname)
char *sysname;
{
@@ -719,12 +727,12 @@ newflist(ftype)
/*
* Add a swap device to the system's configuration
*/
+void
mkswap(system, fl, size, flag)
struct file_list *system, *fl;
int size, flag;
{
register struct file_list **flp;
- char name[80];
if (system == 0 || system->f_type != SYSTEMSPEC) {
yyerror("\"swap\" spec precedes \"config\" specification");
@@ -757,6 +765,7 @@ mkswap(system, fl, size, flag)
system->f_fn = ns(system->f_needs);
}
+void
mkcomp(dp)
register struct device *dp;
{
@@ -777,11 +786,11 @@ mkcomp(dp)
compp = flp;
}
+void
addcomp(compdev, fl)
struct file_list *compdev, *fl;
{
register struct file_list **flp;
- char name[80];
if (compdev == 0 || compdev->f_type != COMPDEVICE) {
yyerror("component spec precedes device specification");
@@ -887,6 +896,7 @@ huhcon(dev)
return (dp);
}
+void
init_dev(dp)
register struct device *dp;
{
@@ -912,6 +922,7 @@ init_dev(dp)
/*
* make certain that this is a reasonable type of thing to connect to a nexus
*/
+void
check_nexus(dev, num)
register struct device *dev;
int num;
@@ -955,6 +966,7 @@ check_nexus(dev, num)
* Check system specification and apply defaulting
* rules on root, argument, dump, and swap devices.
*/
+void
checksystemspec(fl)
register struct file_list *fl;
{
@@ -1022,6 +1034,7 @@ checksystemspec(fl)
* Verify all devices specified in the system specification
* are present in the device specifications.
*/
+void
verifysystemspecs()
{
register struct file_list *fl;
@@ -1059,8 +1072,7 @@ verifyswap(fl, checked, pchecked)
if (alreadychecked(fl->f_swapdev, checked, pchecked))
continue;
if (!finddev(fl->f_swapdev))
- fprintf(stderr,
- "config: swap device %s not configured", fl->f_fn);
+ warnx("swap device %s not configured", fl->f_fn);
*pchecked++ = fl->f_swapdev;
}
return (pchecked);
@@ -1069,6 +1081,7 @@ verifyswap(fl, checked, pchecked)
/*
* Verify that components of a compound device have themselves been config'ed
*/
+void
verifycomp(fl)
register struct file_list *fl;
{
@@ -1077,9 +1090,7 @@ verifycomp(fl)
for (fl = fl->f_next; fl; fl = fl->f_next) {
if (fl->f_type != COMPSPEC || finddev(fl->f_compdev))
continue;
- fprintf(stderr,
- "config: %s: component device %s not configured\n",
- dname, fl->f_needs);
+ warnx("%s: component device %s not configured", dname, fl->f_needs);
}
}
@@ -1087,6 +1098,7 @@ verifycomp(fl)
* Has a device already been checked
* for its existence in the configuration?
*/
+int
alreadychecked(dev, list, last)
dev_t dev, list[];
register dev_t *last;
@@ -1099,12 +1111,11 @@ alreadychecked(dev, list, last)
return (0);
}
+void
deverror(systemname, devtype)
char *systemname, *devtype;
{
-
- fprintf(stderr, "config: %s: %s device not configured\n",
- systemname, devtype);
+ warnx("%s: %s device not configured", systemname, devtype);
}
/*
@@ -1113,6 +1124,7 @@ deverror(systemname, devtype)
* take into account stuff wildcarded.
*/
/*ARGSUSED*/
+int
finddev(dev)
dev_t dev;
{
OpenPOWER on IntegriCloud