From 8a7c811a5bdb7901ad6debcda5fdbfc4ab95a92d Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Wed, 23 Nov 1994 20:36:08 +0000 Subject: [PATCH] Don't core on ``root on qq0 and fx0 and yy0'' specifications; just take the first one and ignore all the rest, giving a warning message. Fixes PR #3. --- usr.sbin/config/config.y | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y index 9a041d066d4b..6773073e1042 100644 --- a/usr.sbin/config/config.y +++ b/usr.sbin/config/config.y @@ -67,7 +67,7 @@ %type device_name %type major_minor %type arg_device_spec -%type root_device_spec +%type root_device_spec root_device_specs %type dump_device_spec %type swap_device_spec %type comp_device_spec @@ -112,6 +112,7 @@ #include "config.h" #include #include +#include struct device cur; struct device *curp = 0; @@ -285,7 +286,7 @@ swap_device_spec: ; root_spec: - ROOT optional_on root_device_spec + ROOT optional_on root_device_specs = { struct file_list *fl = *confp; @@ -296,6 +297,15 @@ root_spec: } ; +root_device_specs: + root_device_spec AND root_device_specs + = { + warnx("extraneous root devices ignored"); + $$ = $1; + } + | root_device_spec + ; + root_device_spec: device_name = { $$ = nametodev($1, 0, 'a'); }