Various fixes.

B - fixed usage, DISPLAY :0 vs :0.0
	9term - fixed various terminal things
	rc - notice traps in Read
	_p9dir - only run disk code for disks
	dirread - getdirentries on FreeBSD and Linux
		are different w.r.t. meaning of off.
	notify - set up so signals interrupt system calls
	bprint - use bfmt.
This commit is contained in:
rsc 2003-12-03 22:50:48 +00:00
parent 5a82f26e50
commit 669250d159
11 changed files with 124 additions and 63 deletions

View file

@ -4,25 +4,17 @@
int
Bprint(Biobuf *bp, char *fmt, ...)
{
va_list ap;
char *ip, *ep, *out;
va_list args;
Fmt f;
int n;
ep = (char*)bp->ebuf;
ip = ep + bp->ocount;
va_start(ap, fmt);
out = vseprint(ip, ep, fmt, ap);
va_end(ap);
if(out == 0 || out >= ep-5) {
Bflush(bp);
ip = ep + bp->ocount;
va_start(ap, fmt);
out = vseprint(ip, ep, fmt, ap);
va_end(ap);
if(out >= ep-5)
return Beof;
}
n = out-ip;
bp->ocount += n;
if(Bfmtinit(&f, bp) < 0)
return -1;
va_start(args, fmt);
f.args = args;
n = dofmt(&f, fmt);
va_end(args);
if(n > 0 && Bfmtflush(&f) < 0)
return -1;
return n;
}