init

Init system
git clone git://git.carbslinux.org/init
Log | Files | Refs | README | LICENSE

commit 3c1b9add8d8dd305106cddec18f1175511aecbe7
parent 8ba323f055f31c10a1c11d78065700b11a55aae4
Author: Cem Keylan <cem@ckyln.com>
Date:   Sat, 16 May 2020 20:56:30 +0300

shalt: don't check for root

Diffstat:
Mbin/shalt.c | 7++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git 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;