diff --git a/sbin/reboot/Makefile b/sbin/reboot/Makefile index 61f0697888b8..1cb270cd8a60 100644 --- a/sbin/reboot/Makefile +++ b/sbin/reboot/Makefile @@ -2,6 +2,7 @@ # $FreeBSD$ PROG= reboot +WARNS?= 6 DPADD= ${LIBUTIL} LDADD= -lutil MAN= reboot.8 boot_i386.8 nextboot.8 diff --git a/sbin/reboot/reboot.c b/sbin/reboot/reboot.c index 9bc866a065ca..0be230035962 100644 --- a/sbin/reboot/reboot.c +++ b/sbin/reboot/reboot.c @@ -65,9 +65,9 @@ int main(int argc, char *argv[]) { struct passwd *pw; - int ch, howto, i, fd, kflag, lflag, nflag, qflag, pflag, sverrno; + int ch, howto, i, fd, lflag, nflag, qflag, pflag, sverrno; u_int pageins; - char *kernel, *p; + char *kernel = NULL, *p; const char *user; if (strstr((p = rindex(*argv, '/')) ? p + 1 : *argv, "halt")) { @@ -75,14 +75,13 @@ main(int argc, char *argv[]) howto = RB_HALT; } else howto = 0; - kflag = lflag = nflag = qflag = 0; + lflag = nflag = qflag = 0; while ((ch = getopt(argc, argv, "dk:lnpq")) != -1) switch(ch) { case 'd': howto |= RB_DUMP; break; case 'k': - kflag = 1; kernel = optarg; break; case 'l': @@ -118,7 +117,7 @@ main(int argc, char *argv[]) err(1, NULL); } - if (kflag) { + if (kernel != NULL) { fd = open("/boot/nextboot.conf", O_WRONLY | O_CREAT, 0444); if (fd > -1) { (void)write(fd, "nextboot_enable=\"YES\"\n", 22);