From 8a92380eef1fe9eb95638c9cda3a6dd7d1d1df1c Mon Sep 17 00:00:00 2001 From: jkh Date: Wed, 24 Nov 1999 09:45:36 +0000 Subject: Clean up the loader.conf write-out code. --- usr.sbin/sysinstall/install.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'usr.sbin/sysinstall') diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index 98f7d6f..82a5622 100644 --- a/usr.sbin/sysinstall/install.c +++ b/usr.sbin/sysinstall/install.c @@ -732,6 +732,8 @@ installFixupBin(dialogMenuItem *self) Device **devs; char *cp; int i; + FILE *fp; + int kstat; /* All of this is done only as init, just to be safe */ if (RunningAsInit) { @@ -747,21 +749,18 @@ installFixupBin(dialogMenuItem *self) /* Snapshot any boot -c changes back to the new kernel */ cp = variable_get(VAR_KGET); if (cp && (*cp == 'Y' || *cp == 'y')) { - if (kget("/boot/kernel.conf")) { + if (kstat = kget("/boot/kernel.conf")) { msgConfirm("Kernel copied OK, but unable to save boot -c changes\n" "to it. See the debug screen (ALT-F2) for details."); } - else if (file_readable("/boot/kernel.conf")) { - FILE *fp; - - if ((fp = fopen("/boot/loader.conf", "a")) != NULL) { - fprintf(fp, "# -- sysinstall generated deltas -- #\n"); - fprintf(fp, "userconfig_script_load=\"YES\"\n"); - if (!OnVTY) - fprintf(fp, "console=\"comconsole\"\n"); - fclose(fp); - } - } + } + if ((fp = fopen("/boot/loader.conf", "a")) != NULL) { + fprintf(fp, "# -- sysinstall generated deltas -- #\n"); + if (!kstat) + fprintf(fp, "userconfig_script_load=\"YES\"\n"); + if (!OnVTY) + fprintf(fp, "console=\"comconsole\"\n"); + fclose(fp); } #endif } -- cgit v1.1