From d3b3c96385a9f456ac7a0e8f7eaa615d1dfc78d4 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Wed, 22 May 2024 19:39:44 -0400 Subject: Remove use of sysexits.h Preserve exit status 69 (EX_UNAVAILABLE) for getting disconnected. Use 127 for failing to exec, like the shell. --- command.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'command.c') diff --git a/command.c b/command.c index 502ff17..9b2b4eb 100644 --- a/command.c +++ b/command.c @@ -516,7 +516,7 @@ static void commandExec(uint id, char *params) { execID = id; pid_t pid = fork(); - if (pid < 0) err(EX_OSERR, "fork"); + if (pid < 0) err(1, "fork"); if (pid) return; setsid(); @@ -527,7 +527,7 @@ static void commandExec(uint id, char *params) { const char *shell = getenv("SHELL") ?: "/bin/sh"; execl(shell, shell, "-c", params, NULL); warn("%s", shell); - _exit(EX_UNAVAILABLE); + _exit(127); } static void commandHelp(uint id, char *params) { @@ -545,7 +545,7 @@ static void commandHelp(uint id, char *params) { uiHide(); pid_t pid = fork(); - if (pid < 0) err(EX_OSERR, "fork"); + if (pid < 0) err(1, "fork"); if (pid) return; char buf[256]; @@ -554,7 +554,7 @@ static void commandHelp(uint id, char *params) { execlp("man", "man", "1", "catgirl", NULL); dup2(utilPipe[1], STDERR_FILENO); warn("man"); - _exit(EX_UNAVAILABLE); + _exit(127); } enum Flag { -- cgit 1.4.1