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.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/reboot/reboot.c b/usr.bin/reboot/reboot.c
index 7fa37f9..445fe3b 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_FLAG_PWR);
+ printf("POWEROFF failed\n");
+ /* Fall through */
default:
printf("got bad flag '%c'\n", c);
break;