about summary refs log tree commit diff
path: root/complete.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 /complete.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--complete.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/complete.c b/complete.c
index 3552c7c..d7108e6 100644
--- a/complete.c
+++ b/complete.c
@@ -28,7 +28,6 @@
 #include <err.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sysexits.h>
 
 #include "chat.h"
 
@@ -47,10 +46,10 @@ static struct Node *tail;
 
 static struct Node *alloc(uint id, const char *str, enum Color color) {
 	struct Node *node = calloc(1, sizeof(*node));
-	if (!node) err(EX_OSERR, "calloc");
+	if (!node) err(1, "calloc");
 	node->id = id;
 	node->str = strdup(str);
-	if (!node->str) err(EX_OSERR, "strdup");
+	if (!node->str) err(1, "strdup");
 	node->color = color;
 	node->bits = 0;
 	return node;
@@ -117,7 +116,7 @@ void completeReplace(const char *old, const char *new) {
 		if (strcmp(node->str, old)) continue;
 		free(node->str);
 		node->str = strdup(new);
-		if (!node->str) err(EX_OSERR, "strdup");
+		if (!node->str) err(1, "strdup");
 		prepend(detach(node));
 	}
 }