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. --- filter.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'filter.c') diff --git a/filter.c b/filter.c index a7f9a29..bbe40c8 100644 --- a/filter.c +++ b/filter.c @@ -31,7 +31,6 @@ #include #include #include -#include #include "chat.h" @@ -48,14 +47,14 @@ struct Filter filterParse(enum Heat heat, char *pattern) { } struct Filter filterAdd(enum Heat heat, const char *pattern) { - if (len == FilterCap) errx(EX_CONFIG, "filter limit exceeded"); + if (len == FilterCap) errx(1, "filter limit exceeded"); char *own; if (!strchr(pattern, '!') && !strchr(pattern, ' ')) { int n = asprintf(&own, "%s!*@*", pattern); - if (n < 0) err(EX_OSERR, "asprintf"); + if (n < 0) err(1, "asprintf"); } else { own = strdup(pattern); - if (!own) err(EX_OSERR, "strdup"); + if (!own) err(1, "strdup"); } struct Filter filter = filterParse(heat, own); filters[len++] = filter; @@ -105,7 +104,7 @@ static void icedPush(const char *msgID) { size_t i = iced.len % IcedCap; free(iced.msgIDs[i]); iced.msgIDs[i] = strdup(msgID); - if (!iced.msgIDs[i]) err(EX_OSERR, "strdup"); + if (!iced.msgIDs[i]) err(1, "strdup"); iced.len++; } -- cgit 1.4.1