summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornatano <natano@openbsd.org>2016-10-16 08:47:17 +0000
committernatano <natano@openbsd.org>2016-10-16 08:47:17 +0000
commitfdaef70e8337dff91ea038329b20a7caa49034d4 (patch)
treebedc0ae1d1e094bd5a6e4a057a6a1e483bd3165e
parentswitch to a re-exec model instead of plain forking to reduce sharing. (diff)
downloadwireguard-openbsd-fdaef70e8337dff91ea038329b20a7caa49034d4.tar.xz
wireguard-openbsd-fdaef70e8337dff91ea038329b20a7caa49034d4.zip
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
-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");
}