From b2cfc4e2e71d0f0a5113ddfbd93c8285cc4d74e4 Mon Sep 17 00:00:00 2001 From: rsc Date: Tue, 30 Sep 2003 17:47:41 +0000 Subject: Initial revision --- src/lib9/sysfatal.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/lib9/sysfatal.c (limited to 'src/lib9/sysfatal.c') diff --git a/src/lib9/sysfatal.c b/src/lib9/sysfatal.c new file mode 100644 index 00000000..f9ab6985 --- /dev/null +++ b/src/lib9/sysfatal.c @@ -0,0 +1,20 @@ +#include + +void (*_sysfatal)(char*, ...); + +void +sysfatal(char *fmt, ...) +{ + char buf[256]; + va_list arg; + + va_start(arg, fmt); + if(_sysfatal) + (*_sysfatal)(fmt, arg); + vseprint(buf, buf+sizeof buf, fmt, arg); + va_end(arg); + + fprint(2, "%s; %s\n", argv0 ? argv0 : "", buf); + exits("fatal"); +} + -- cgit v1.2.3