summaryrefslogtreecommitdiff
path: root/panic.c
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-01-24 21:17:08 +0100
committerAki <please@ignore.pl>2022-01-24 21:17:08 +0100
commite4c74e9d1c97feccb0c5337baceab4fc4aec592c (patch)
treefe369763f7b0ad6ccb50eeb22ef9453eb694fffd /panic.c
downloadcoreutils-e4c74e9d1c97feccb0c5337baceab4fc4aec592c.zip
coreutils-e4c74e9d1c97feccb0c5337baceab4fc4aec592c.tar.gz
coreutils-e4c74e9d1c97feccb0c5337baceab4fc4aec592c.tar.bz2
Merged two random sources into this repository
Diffstat (limited to 'panic.c')
-rw-r--r--panic.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/panic.c b/panic.c
new file mode 100644
index 0000000..ef4475e
--- /dev/null
+++ b/panic.c
@@ -0,0 +1,14 @@
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdnoreturn.h>
+
+
+noreturn void panic(char * fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vdprintf(2, fmt, args);
+ va_end(args);
+ exit(1);
+}