libbio: report Bflush/close error from Bterm
This commit is contained in:
parent
f7f0512875
commit
4af8158b53
@ -141,13 +141,15 @@ Bopen(char *name, int mode)
|
||||
int
|
||||
Bterm(Biobuf *bp)
|
||||
{
|
||||
int ret;
|
||||
|
||||
deinstall(bp);
|
||||
Bflush(bp);
|
||||
ret = Bflush(bp);
|
||||
if(bp->flag == Bmagic) {
|
||||
bp->flag = 0;
|
||||
close(bp->fid);
|
||||
if(close(bp->fid) < 0)
|
||||
ret = -1;
|
||||
free(bp);
|
||||
}
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user