summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/mkoptions.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2000-01-08 16:48:12 +0000
committerpeter <peter@FreeBSD.org>2000-01-08 16:48:12 +0000
commitc714ed458538bef1f027e8ae35e11b74a934599f (patch)
tree1477b047f8936f2d04b86998b48f0be6858d9b42 /usr.sbin/config/mkoptions.c
parent27629843b562745fcc1fe1d5d008fb30d613bb86 (diff)
downloadFreeBSD-src-c714ed458538bef1f027e8ae35e11b74a934599f.zip
FreeBSD-src-c714ed458538bef1f027e8ae35e11b74a934599f.tar.gz
Support getting *.$MACHINE from sys/conf as well as sys/$MACHINE/conf.
This would mean that we could move files.alpha, files.i386, files.pc98 etc all next to conf/files, and the various Makefiles next to each other. This should go a long way towards committers "seeing" the Alpha etc stuff and remembering to update that too as it would be right next to the i386 config files. Note this does not include the GENERIC etc files as they can't be shared. I haven't actually moved the files, but the support is here for it. It still supports the per-machine conf directories so that folks working on a new arch can just distribute a subdir of files.
Diffstat (limited to 'usr.sbin/config/mkoptions.c')
-rw-r--r--usr.sbin/config/mkoptions.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.sbin/config/mkoptions.c b/usr.sbin/config/mkoptions.c
index a6f44eb..d8e4dbb 100644
--- a/usr.sbin/config/mkoptions.c
+++ b/usr.sbin/config/mkoptions.c
@@ -290,28 +290,32 @@ read_options()
char genopt[80];
otab = 0;
+ if (ident == NULL) {
+ printf("no ident line specified\n");
+ exit(1);
+ }
(void) snprintf(fname, sizeof fname, "../../conf/options");
openit:
fp = fopen(fname, "r");
if (fp == 0) {
return;
}
- if (ident == NULL) {
- printf("no ident line specified\n");
- exit(1);
- }
next:
wd = get_word(fp);
if (wd == (char *)EOF) {
(void) fclose(fp);
if (first == 1) {
- (void) snprintf(fname, sizeof fname, "options.%s", machinename);
first++;
+ (void) snprintf(fname, sizeof fname, "../../conf/options.%s", machinename);
+ fp = fopen(fname, "r");
+ if (fp != 0)
+ goto next;
+ (void) snprintf(fname, sizeof fname, "options.%s", machinename);
goto openit;
}
if (first == 2) {
- (void) snprintf(fname, sizeof fname, "options.%s", raisestr(ident));
first++;
+ (void) snprintf(fname, sizeof fname, "options.%s", raisestr(ident));
fp = fopen(fname, "r");
if (fp != 0)
goto next;
OpenPOWER on IntegriCloud