mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-01 00:18:15 +01:00
Revert back to old config behavior if compiled with -DCONFIG_DONT_CLOBBER.
This commit is contained in:
parent
db141545dc
commit
c33f35354b
@ -2,6 +2,9 @@
|
||||
|
||||
PROG= config
|
||||
CFLAGS+=-I. -I${.CURDIR} -DSTATCLOCK
|
||||
.if defined(CONFIG_DONT_CLOBBER)
|
||||
CFLAGS+= -DCONFIG_DONT_CLOBBER
|
||||
.endif
|
||||
SRCS= config.c main.c lang.c mkioconf.c mkmakefile.c mkglue.c mkheaders.c \
|
||||
mkswapconf.c
|
||||
MAN8= config.8
|
||||
|
@ -90,8 +90,12 @@ usage: fputs("usage: config [-gp] sysname\n", stderr);
|
||||
perror(PREFIX);
|
||||
exit(2);
|
||||
}
|
||||
#ifndef CONFIG_DONT_CLOBBER
|
||||
if (stat(p = path((char *)NULL), &buf)) {
|
||||
#else /* CONFIG_DONT_CLOBBER */
|
||||
p = path((char *)NULL);
|
||||
if (stat(p, &buf)) {
|
||||
#endif /* CONFIG_DONT_CLOBBER */
|
||||
if (mkdir(p, 0777)) {
|
||||
perror(p);
|
||||
exit(2);
|
||||
@ -100,6 +104,7 @@ usage: fputs("usage: config [-gp] sysname\n", stderr);
|
||||
else if ((buf.st_mode & S_IFMT) != S_IFDIR) {
|
||||
fprintf(stderr, "config: %s isn't a directory.\n", p);
|
||||
exit(2);
|
||||
#ifdef CONFIG_DONT_CLOBBER
|
||||
}
|
||||
else {
|
||||
char tmp[strlen(p) + 8];
|
||||
@ -117,6 +122,7 @@ usage: fputs("usage: config [-gp] sysname\n", stderr);
|
||||
perror(p);
|
||||
exit(2);
|
||||
}
|
||||
#endif /* CONFIG_DONT_CLOBBER */
|
||||
}
|
||||
|
||||
loadaddress = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user