summaryrefslogtreecommitdiff
path: root/sbin/init
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>1999-11-22 04:23:11 +0000
committerMatthew Dillon <dillon@FreeBSD.org>1999-11-22 04:23:11 +0000
commita69497d73f291fa90cc3dc2ec1bc35b2d9cf4b73 (patch)
treedb8aaaa6673d31f85b8712d63eb284e6fb9ce007 /sbin/init
parent05e68e47a31ae57996595d549bc1f063ec5b2f50 (diff)
Notes
Diffstat (limited to 'sbin/init')
-rw-r--r--sbin/init/init.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c
index 75287b5d4e4c..30453a93fae4 100644
--- a/sbin/init/init.c
+++ b/sbin/init/init.c
@@ -646,7 +646,8 @@ single_user()
*/
typ = getttynam("console");
pp = getpwnam("root");
- if (typ && (typ->ty_status & TTY_SECURE) == 0 && pp && *pp->pw_passwd) {
+ if (typ && (typ->ty_status & TTY_SECURE) == 0 &&
+ pp && *pp->pw_passwd) {
write(2, banner, sizeof banner - 1);
for (;;) {
clear = getpass("Password:");
@@ -1488,7 +1489,7 @@ runshutdown()
int status;
int shutdowntimeout;
size_t len;
- char *argv[3];
+ char *argv[4];
struct sigaction sa;
struct stat sb;
@@ -1527,7 +1528,11 @@ runshutdown()
*/
argv[0] = "sh";
argv[1] = _PATH_RUNDOWN;
- argv[2] = 0;
+ if (Reboot)
+ argv[2] = "reboot";
+ else
+ argv[2] = "single";
+ argv[3] = 0;
sigprocmask(SIG_SETMASK, &sa.sa_mask, (sigset_t *) 0);