summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMartin Natano <natano@cvs.openbsd.org>2016-10-16 08:47:18 +0000
committerMartin Natano <natano@cvs.openbsd.org>2016-10-16 08:47:18 +0000
commit0a717aae3b232095924eb23ac57806daa7e5b3ed (patch)
tree09b96d3a5c08a827dd000beb17ef39f84c9aaea6 /usr.sbin
parent7a7e82fe54f1eee067bfeb43cd8a2c49df27bfa0 (diff)
Stop complaining about changed kernel options when called for an empty
directory. With the new kernel obj mechanism config always prints Kernel options have changed -- you must run "make clean" on the first run. The message is suppressed when the compile directory didn't exist before, but now the directory always exists when config is run, so we have to use something else to detect if this is a "fresh" run or an update of an existing directory. Use the options file instead, which is used to track the kernel options of the last config run. If the file doesn't exist, it is safe to assume, that this is a "fresh" directory. ok tb deraadt
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/config/main.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c
index 8e7e60c5597..193e9dd6f4b 100644
--- a/usr.sbin/config/main.c
+++ b/usr.sbin/config/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.52 2016/10/14 18:51:04 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.53 2016/10/16 08:47:17 natano Exp $ */
/* $NetBSD: main.c,v 1.22 1997/02/02 21:12:33 thorpej Exp $ */
/*
@@ -76,8 +76,6 @@ static int hasparent(struct devi *);
static int cfcrosscheck(struct config *, const char *, struct nvlist *);
static void optiondelta(void);
-int madedir = 0;
-
int verbose;
void
@@ -684,7 +682,6 @@ setupdirs(void)
builddir, strerror(errno));
exit(2);
}
- madedir = 1;
} else if (!S_ISDIR(st.st_mode)) {
(void)fprintf(stderr, "config: %s is not a directory\n",
builddir);
@@ -788,7 +785,7 @@ optiondelta(void)
}
fclose(fp);
fp = NULL;
- } else
+ } else if (access("options", F_OK) == 0)
ret = 1;
/* replace with the new list of options */
@@ -804,7 +801,7 @@ optiondelta(void)
fclose(fp);
}
free(newopts);
- if (ret == 0 || madedir == 1)
+ if (ret == 0)
return;
(void)printf("Kernel options have changed -- you must run \"make clean\"\n");
}