summaryrefslogtreecommitdiff
path: root/include/err.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/err.h')
-rw-r--r--include/err.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/err.h b/include/err.h
new file mode 100644
index 000000000..5bd51ea0d
--- /dev/null
+++ b/include/err.h
@@ -0,0 +1,7 @@
+#ifndef __ERR_H__
+#define __ERR_H__
+
+#define warn(X,args...) ({char _buf[128]; sprintf(_buf, X,args); perror(_buf);})
+#define err(X,Y,args...) ({char _buf[128]; sprintf(_buf, Y,##args); perror(_buf); exit(X);})
+
+#endif /* __ERR_H__ */