From 430bca8a0f166df268e2fa8fb207286640bd0602 Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Sun, 5 Jul 2026 18:30:38 +0200 Subject: Add a sys_check routine --- src/system.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/system.c') diff --git a/src/system.c b/src/system.c index df53e99..2f95661 100644 --- a/src/system.c +++ b/src/system.c @@ -10,6 +10,16 @@ #include #include "system.h" +#include "utils.h" + +void __sys_check(int cond, const char *prefix, const char *file, int line) +{ + if (!cond) { + fprintf(stderr, "%s:%d: %s: ", file, line, prefix); + perror(""); + exit(EXIT_FAILURE); + } +} int file_exists(const char *path) { -- cgit v1.2.3