| commit | b2cfc4e2e71d0f0a5113ddfbd93c8285cc4d74e4 | [log] [tgz] |
|---|---|---|
| author | rsc <devnull@localhost> | Tue Sep 30 17:47:41 2003 +0000 |
| committer | rsc <devnull@localhost> | Tue Sep 30 17:47:41 2003 +0000 |
| tree | f382987fec33cf639d75b1fe1b5d76b8f155d074 | |
| parent | 5f7d5e8d1899f41b0e5366c0251530ea1dc753d0 [diff] [blame] |
Initial revision
diff --git a/src/lib9/sysfatal.c b/src/lib9/sysfatal.c new file mode 100644 index 0000000..f9ab698 --- /dev/null +++ b/src/lib9/sysfatal.c
@@ -0,0 +1,20 @@ +#include <lib9.h> + +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 : "<prog>", buf); + exits("fatal"); +} +