about summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2024-05-22 19:39:44 -0400
committerJune McEnroe <june@causal.agency>2024-05-22 19:39:44 -0400
commitd3b3c96385a9f456ac7a0e8f7eaa615d1dfc78d4 (patch)
tree920ef7c7a642d01d8063f234ef4c63d865ad9808 /command.c
parentPronouns (diff)
downloadcatgirl-d3b3c96385a9f456ac7a0e8f7eaa615d1dfc78d4.tar.gz
catgirl-d3b3c96385a9f456ac7a0e8f7eaa615d1dfc78d4.zip
Remove use of sysexits.h
Preserve exit status 69 (EX_UNAVAILABLE) for getting disconnected.
Use 127 for failing to exec, like the shell.
Diffstat (limited to '')
-rw-r--r--command.c8
1 files changed, 4 insertions, 4 deletions
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 {