diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/osh/osh.c | 10 | ||||
-rw-r--r-- | usr.bin/reboot/reboot.c | 8 |
2 files changed, 7 insertions, 11 deletions
diff --git a/usr.bin/osh/osh.c b/usr.bin/osh/osh.c index 1c9f508..71ca6de 100644 --- a/usr.bin/osh/osh.c +++ b/usr.bin/osh/osh.c @@ -29,7 +29,6 @@ #include <sys/types.h> #include <sys/cdefs.h> -#include <sys/reboot.h> #include <sys/errno.h> #include <sys/spawn.h> #include <sys/wait.h> @@ -58,7 +57,6 @@ "help - Display this help message\n" \ "echo - Print the arguments to the console\n" \ "reboot - Reboot the machine\n" \ - "shutdown - Power off the machine\n" \ "kmsg - Print kernel message buffer\n" \ "fetch - System information\n" \ "kfg - Start up kfgwm\n" \ @@ -78,7 +76,6 @@ static bool bs_bell = true; /* Beep on backspace */ static void cmd_help(int argc, char *argv[]); static void cmd_echo(int argc, char *argv[]); static void cmd_exit(int argc, char *argv[]); -static void cmd_shutdown(int argc, char *argv[]); static void cmd_bell(int argc, char *argv[]); static void cmd_clear(int argc, char *argv[]); @@ -99,7 +96,6 @@ struct parse_state { static struct builtin_cmd cmds[] = { {"help",cmd_help}, {"exit",cmd_exit}, - {"shutdown", cmd_shutdown}, {"bell", cmd_bell}, {"clear", cmd_clear}, {NULL, NULL} @@ -118,12 +114,6 @@ cmd_exit(int argc, char *argv[]) } static void -cmd_shutdown(int argc, char *argv[]) -{ - cpu_reboot(REBOOT_POWEROFF | REBOOT_HALT); -} - -static void cmd_clear(int argc, char *argv[]) { fputs("\033[2J", stdout); diff --git a/usr.bin/reboot/reboot.c b/usr.bin/reboot/reboot.c index 7fa37f9..07dc74f 100644 --- a/usr.bin/reboot/reboot.c +++ b/usr.bin/reboot/reboot.c @@ -31,9 +31,10 @@ #include <stdio.h> #include <unistd.h> -#define REBOOT_FLAGS "rh" +#define REBOOT_FLAGS "rhp" #define REBOOT_FLAG_RB 'r' /* Reboot */ #define REBOOT_FLAG_HLT 'h' /* Halt */ +#define REBOOT_FLAG_PWR 'p' /* Power off */ static void help(void) @@ -43,6 +44,7 @@ help(void) "flags:\n" " [-r] Reboot\n" " [-h] Halt\n" + " [-p] Power off\n" ); } @@ -71,6 +73,10 @@ main(int argc, char **argv) cpu_reboot(REBOOT_FLAG_HLT); printf("HALT failed\n"); /* Fall through */ + case REBOOT_FLAG_PWR: + cpu_reboot(REBOOT_POWEROFF); + printf("POWEROFF failed\n"); + /* Fall through */ default: printf("got bad flag '%c'\n", c); break; |