Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Nov 2005 19:06:26 GMT
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 87455 for review
Message-ID:  <200511291906.jATJ6QnU022713@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=87455

Change 87455 by peter@peter_melody on 2005/11/29 19:06:13

	When DEFAULTS was added, the existence check of the main
	config file was deferred till AFTER a mkdir of ../compile/[*argv]
	This leads to garbage directories being created.  As a hack, do an
	explicit open test for the named config file.

Affected files ...

.. //depot/projects/hammer/usr.sbin/config/main.c#11 edit

Differences ...

==== //depot/projects/hammer/usr.sbin/config/main.c#11 (text+ko) ====

@@ -96,6 +96,7 @@
 	int ch, len;
 	char *p;
 	char xxx[MAXPATHLEN];
+	FILE *fp;
 
 	while ((ch = getopt(argc, argv, "d:gpV")) != -1)
 		switch (ch) {
@@ -125,6 +126,10 @@
 		usage();
 
 	PREFIX = *argv;
+	fp = fopen(PREFIX, "r");
+	if (fp == NULL)
+		err(2, "%s", PREFIX);
+	fclose(fp);
 	if (freopen("DEFAULTS", "r", stdin) != NULL) {
 		found_defaults = 1;
 		yyfile = "DEFAULTS";



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