diff options
Diffstat (limited to 'bin/shalt.c')
-rw-r--r-- | bin/shalt.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/bin/shalt.c b/bin/shalt.c index 924d85d..b2e199d 100644 --- a/bin/shalt.c +++ b/bin/shalt.c @@ -1,11 +1,8 @@ -#include <unistd.h> +// shalt -- simple halt utility #include <sys/reboot.h> -/* Simple halt utility */ -/* Reboot if the argument is r, Poweroff is the argument is p */ - int main (int argc, char *argv[]) { - switch ((int)argv[argc < 2 ? 0 : 1][0] + geteuid()) { + switch ((int)argv[argc < 2 ? 0 : 1][0]) { case 'p': reboot(RB_POWER_OFF); break; case 'r': reboot(RB_AUTOBOOT); break; default: return 1; |