summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/main.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2007-05-17 04:53:52 +0000
committerimp <imp@FreeBSD.org>2007-05-17 04:53:52 +0000
commit5907a150d5e9ac5dbdae3755e2ea48c482dcff3c (patch)
tree2fdb18be10336648c3e3ee75a8e5f772db10e663 /usr.sbin/config/main.c
parent107e03db097aaf6b92c0c4fd82fb3bad5c5abc97 (diff)
downloadFreeBSD-src-5907a150d5e9ac5dbdae3755e2ea48c482dcff3c.zip
FreeBSD-src-5907a150d5e9ac5dbdae3755e2ea48c482dcff3c.tar.gz
Fix some problems that affect multiple file inclusion. Bruce found
this bug and submitted these patches to dunstan@. He sent them to me to test, and I discovered they were needed for the atmel kernel config files. Since we were playing with them in the terminal room after the developer's summit today, I thought I'd go ahead and commit them to allow those folks that now have atmel hardware (thanks Andre) a chance to try it out w/o my help. Since dunstan@ is asleep right now, risk stepping on his toes a little by going ahead and committing this change. Submitted by: dunstan@, bde@ Tested by: bde@
Diffstat (limited to 'usr.sbin/config/main.c')
-rw-r--r--usr.sbin/config/main.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c
index c0c6b2a..a3b300a 100644
--- a/usr.sbin/config/main.c
+++ b/usr.sbin/config/main.c
@@ -150,14 +150,14 @@ main(int argc, char **argv)
usage();
PREFIX = *argv;
- /*
- * We mark lack of DEFAULTS here. Once we hit EOF in PREFIX, yywrap()
- * will try to bring DEFAULTS to the playground, if this exists.
- */
- found_defaults = 0;
- if (freopen(PREFIX, "r", stdin) == NULL)
- err(2, "%s", PREFIX);
- yyfile = PREFIX;
+ if (freopen("DEFAULTS", "r", stdin) != NULL) {
+ found_defaults = 1;
+ yyfile = "DEFAULTS";
+ } else {
+ if (freopen(PREFIX, "r", stdin) == NULL)
+ err(2, "%s", PREFIX);
+ yyfile = PREFIX;
+ }
if (*destdir != '\0') {
len = strlen(destdir);
while (len > 1 && destdir[len - 1] == '/')
@@ -184,7 +184,6 @@ main(int argc, char **argv)
STAILQ_INIT(&fntab);
STAILQ_INIT(&ftab);
STAILQ_INIT(&hints);
- STAILQ_INIT(&rmdtab);
if (yyparse())
exit(3);
OpenPOWER on IntegriCloud