diff options
| author | verdant <im@verdant.ee> | 2026-07-21 19:00:56 +0800 |
|---|---|---|
| committer | verdant <im@verdant.ee> | 2026-07-21 19:00:56 +0800 |
| commit | 015263141def1a33649fdb0e85c8c137a7d522f2 (patch) | |
| tree | d16c26f32ce46dc09567791aec0f40f1d6738fc5 | |
| parent | daacae045dc8b33227b006ab801c4f31884129a7 (diff) | |
| download | sf-015263141def1a33649fdb0e85c8c137a7d522f2.tar.gz sf-015263141def1a33649fdb0e85c8c137a7d522f2.zip | |
Add error handing functions
| -rw-r--r-- | err.c | 15 | ||||
| -rw-r--r-- | err.h | 8 |
2 files changed, 23 insertions, 0 deletions
@@ -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); +} @@ -0,0 +1,8 @@ +#ifndef SS_ERR_H +#define SS_ERR_H + +#include <stdarg.h> + +void die(const char* err, ...); + +#endif /* SS_ERR_H */ |
