]> git.lizzy.rs Git - plan9front.git/blob - sys/src/libbio/blethal.c
ether82563: support for i211 with iNVM. (thanks mfny and brennan for testing)
[plan9front.git] / sys / src / libbio / blethal.c
1 #include        <u.h>
2 #include        <libc.h>
3 #include        <bio.h>
4
5 void
6 Berror(Biobufhdr *bp, char *fmt, ...)
7 {
8         va_list va;
9         char buf[ERRMAX];
10
11         if(bp->errorf == nil)
12                 return;
13         
14         va_start(va, fmt);
15         vsnprint(buf, ERRMAX, fmt, va);
16         va_end(va);
17         bp->errorf(buf);
18 }
19
20 static void
21 Bpanic(char *s)
22 {
23         sysfatal("%s", s);
24 }
25
26 void
27 Blethal(Biobufhdr *bp, void (*errorf)(char *))
28 {
29         if(errorf == nil)
30                 errorf = Bpanic;
31
32         bp->errorf = errorf;
33 }