about summary refs log tree commit diff
path: root/window.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 /window.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 'window.c')
-rw-r--r--window.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/window.c b/window.c
index f700fd7..2e79a65 100644
--- a/window.c
+++ b/window.c
@@ -35,7 +35,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sysexits.h>
 #include <time.h>
 
 #include "chat.h"
@@ -107,7 +106,7 @@ uint windowFor(uint id) {
 	}
 
 	struct Window *window = calloc(1, sizeof(*window));
-	if (!window) err(EX_OSERR, "malloc");
+	if (!window) err(1, "malloc");
 
 	window->id = id;
 	window->mark = true;
@@ -132,7 +131,7 @@ void windowInit(void) {
 
 	struct tm *time = localtime(&(time_t) { -22100400 });
 	size_t len = strftime(buf, sizeof(buf), fmt, time);
-	if (!len) errx(EX_CONFIG, "invalid timestamp format: %s", fmt);
+	if (!len) errx(1, "invalid timestamp format: %s", fmt);
 
 	int y;
 	waddstr(uiMain, buf);
@@ -622,14 +621,14 @@ int windowSave(FILE *file) {
 static time_t readTime(FILE *file) {
 	time_t time;
 	fread(&time, sizeof(time), 1, file);
-	if (ferror(file)) err(EX_IOERR, "fread");
-	if (feof(file)) errx(EX_DATAERR, "unexpected end of save file");
+	if (ferror(file)) err(1, "fread");
+	if (feof(file)) errx(1, "unexpected end of save file");
 	return time;
 }
 
 static ssize_t readString(FILE *file, char **buf, size_t *cap) {
 	ssize_t len = getdelim(buf, cap, '\0', file);
-	if (len < 0 && !feof(file)) err(EX_IOERR, "getdelim");
+	if (len < 0 && !feof(file)) err(1, "getdelim");
 	return len;
 }