Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Aug 2019 02:35:53 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r351155 - head/usr.sbin/config
Message-ID:  <201908170235.x7H2ZrS7033175@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Sat Aug 17 02:35:53 2019
New Revision: 351155
URL: https://svnweb.freebsd.org/changeset/base/351155

Log:
  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.

Modified:
  head/usr.sbin/config/main.c

Modified: head/usr.sbin/config/main.c
==============================================================================
--- head/usr.sbin/config/main.c	Sat Aug 17 01:49:57 2019	(r351154)
+++ head/usr.sbin/config/main.c	Sat Aug 17 02:35:53 2019	(r351155)
@@ -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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908170235.x7H2ZrS7033175>