diff options
Diffstat (limited to 'src/system.c')
| -rw-r--r-- | src/system.c | 10 |
1 files changed, 10 insertions, 0 deletions
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 <unistd.h> #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) { |
