ref: 9932106f454eefb3717cc2681ede8b71c7610f5c
parent: 8902d79b624f534e90a8f270980a8c2b46efa38d
author: aiju <aiju@phicode.de>
date: Wed Jul 13 05:30:08 EDT 2011
forgot important file...
--- /dev/null
+++ b/sys/src/libbio/blethal.c
@@ -1,0 +1,33 @@
+#include <u.h>
+#include <libc.h>
+#include <bio.h>
+
+void
+Berror(Biobufhdr *bp, char *fmt, ...)
+{+ va_list va;
+ char buf[ERRMAX];
+
+ if(bp->errorf == nil)
+ return;
+
+ va_start(va, fmt);
+ vsnprint(buf, ERRMAX, fmt, va);
+ va_end(va);
+ bp->errorf(buf);
+}
+
+static void
+Bpanic(char *s)
+{+ sysfatal("%s", s);+}
+
+void
+Blethal(Biobufhdr *bp, void (*errorf)(char *))
+{+ if(errorf == nil)
+ errorf = Bpanic;
+
+ bp->errorf = errorf;
+}
--
⑨