aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--err.c15
-rw-r--r--err.h8
2 files changed, 23 insertions, 0 deletions
diff --git a/err.c b/err.c
new file mode 100644
index 0000000..24b2c7b
--- /dev/null
+++ b/err.c
@@ -0,0 +1,15 @@
+#include "err.h"
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "log.h"
+
+void die(const char* err, ...) {
+ va_list p;
+ va_start(p, err);
+ log_write(LOG_ERR, err, p);
+ va_end(p);
+ exit(128);
+}
diff --git a/err.h b/err.h
new file mode 100644
index 0000000..6bb4697
--- /dev/null
+++ b/err.h
@@ -0,0 +1,8 @@
+#ifndef SS_ERR_H
+#define SS_ERR_H
+
+#include <stdarg.h>
+
+void die(const char* err, ...);
+
+#endif /* SS_ERR_H */