diff options
author | Cem Keylan <cem@ckyln.com> | 2020-05-16 20:56:30 +0300 |
---|---|---|
committer | Cem Keylan <cem@ckyln.com> | 2020-05-16 20:56:30 +0300 |
commit | 3c1b9add8d8dd305106cddec18f1175511aecbe7 (patch) | |
tree | 23d527c11d3c5dc8d58c107dd3f0d09e21678541 /bin | |
parent | 8ba323f055f31c10a1c11d78065700b11a55aae4 (diff) | |
download | init-3c1b9add8d8dd305106cddec18f1175511aecbe7.tar.gz |
shalt: don't check for root
Diffstat (limited to 'bin')
-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; |