summaryrefslogtreecommitdiff
path: root/usr.bin/reboot/reboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/reboot/reboot.c')
-rw-r--r--usr.bin/reboot/reboot.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/reboot/reboot.c b/usr.bin/reboot/reboot.c
index 7fa37f9..ac9785a 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"
);
}
@@ -68,9 +70,13 @@ main(int argc, char **argv)
printf("REBOOT failed\n");
/* Fall through */
case REBOOT_FLAG_HLT:
- cpu_reboot(REBOOT_FLAG_HLT);
+ cpu_reboot(REBOOT_HALT);
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;