PERFORCE change 87455 for review

Peter Wemm peter at FreeBSD.org
Tue Nov 29 19:06:42 GMT 2005


http://perforce.freebsd.org/chv.cgi?CH=87455

Change 87455 by peter at 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";


More information about the p4-projects mailing list