[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

i think that we have to move ioconf.incl.hpcmips by hand is a bug of config(8)



ioconf.incl.hpcmips を手で copy しないといけないのは, config(8) に 
build / soruce directive が追加されたときに入った bug のためだと思いま
す (cf. rev 1.31 の mkmakefile.c).

mkioconf.c を以下のように変更するのが正しいでしょう.  問題なければ後で 
commit しておきます.

enami.
Index: mkioconf.c
===================================================================
RCS file: /cvsroot/syssrc/usr.sbin/config/mkioconf.c,v
retrieving revision 1.51
diff -u -r1.51 mkioconf.c
--- mkioconf.c	1999/01/21 13:10:09	1.51
+++ mkioconf.c	1999/09/24 03:26:34
@@ -121,8 +121,9 @@
 	FILE *ofp;
 {
 	FILE *ifp;
-	int n;
-	char ifn[200], buf[BUFSIZ];
+	int n, rv;
+	char ifnbuf[200], buf[BUFSIZ];
+	char *ifn;
 
 	if (fprintf(ofp, "\
 /*\n\
@@ -131,16 +132,21 @@
  * ioconf.c, from \"%s\"\n\
  */\n\n", conffile) < 0)
 		return (1);
-	(void)sprintf(ifn, "ioconf.incl.%s", machine);
+
+	rv = 0;
+	(void)snprintf(ifnbuf, sizeof(ifnbuf), "arch/%s/conf/ioconf.incl.%s",
+	    machine, machine);
+	ifn = sourcepath(ifnbuf);
 	if ((ifp = fopen(ifn, "r")) != NULL) {
 		while ((n = fread(buf, 1, sizeof(buf), ifp)) > 0)
-			if (fwrite(buf, 1, n, ofp) != n)
-				return (1);
-		if (ferror(ifp)) {
+			if (fwrite(buf, 1, n, ofp) != n) {
+				rv = 1;
+				break;
+			}
+		if (rv == 0 && ferror(ifp)) {
 			(void)fprintf(stderr, "config: error reading %s: %s\n",
 			    ifn, strerror(errno));
-			(void)fclose(ifp);
-			return (-1);
+			rv = -1;
 		}
 		(void)fclose(ifp);
 	} else {
@@ -149,9 +155,10 @@
 #include <sys/conf.h>\n\
 #include <sys/device.h>\n\
 #include <sys/mount.h>\n", ofp) < 0)
-			return (1);
+			rv = 1;
 	}
-	return (0);
+	free(ifn);
+	return (rv);
 }
 
 static int