aboutsummaryrefslogtreecommitdiff
path: root/common/err.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/err.h')
-rw-r--r--common/err.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/err.h b/common/err.h
index 34620bb..b9faf11 100644
--- a/common/err.h
+++ b/common/err.h
@@ -14,4 +14,14 @@ static inline void error(const char *format, ...)
exit(1);
}
+static inline void syserror(const char *call, FILE *file)
+{
+ perror(call);
+
+ if (file)
+ fclose(file);
+
+ exit(1);
+}
+
#endif