Move initializations of config earlier.

Inizialize global variables earlier in the process. It doesn't matter today, but
may in the future if we want to access these lists earlier in config's run.
This commit is contained in:
Warner Losh 2019-08-17 02:35:53 +00:00
parent f4aa9b67eb
commit 622c9cdd31
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=351155

View File

@ -120,6 +120,16 @@ main(int argc, char **argv)
printmachine = 0;
kernfile = NULL;
SLIST_INIT(&includepath);
SLIST_INIT(&cputype);
SLIST_INIT(&mkopt);
SLIST_INIT(&opt);
SLIST_INIT(&rmopts);
STAILQ_INIT(&cfgfiles);
STAILQ_INIT(&dtab);
STAILQ_INIT(&fntab);
STAILQ_INIT(&ftab);
STAILQ_INIT(&hints);
STAILQ_INIT(&envvars);
while ((ch = getopt(argc, argv, "Cd:gI:mps:Vx:")) != -1)
switch (ch) {
case 'C':
@ -197,16 +207,6 @@ main(int argc, char **argv)
strlcat(destdir, PREFIX, sizeof(destdir));
}
SLIST_INIT(&cputype);
SLIST_INIT(&mkopt);
SLIST_INIT(&opt);
SLIST_INIT(&rmopts);
STAILQ_INIT(&cfgfiles);
STAILQ_INIT(&dtab);
STAILQ_INIT(&fntab);
STAILQ_INIT(&ftab);
STAILQ_INIT(&hints);
STAILQ_INIT(&envvars);
if (yyparse())
exit(3);