diff options
-rw-r--r-- | halt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/halt.c b/halt.c index 3f1062e..bb6f8ff 100644 --- a/halt.c +++ b/halt.c @@ -63,11 +63,11 @@ int main(int argc, char *argv[]) { int opt; action_type action = NOOP; - if (strcmp(__progname, "halt") == 0) + if (strncmp(__progname, "halt", 4) == 0) action = HALT; - else if (strcmp(__progname, "reboot") == 0) + else if (strncmp(__progname, "reboot", 6) == 0) action = REBOOT; - else if (strcmp(__progname, "poweroff") == 0) + else if (strncmp(__progname, "poweroff", 8) == 0) action = POWEROFF; else warnx("no default behavior, needs to be called as halt/reboot/poweroff."); |