libbio: report Bflush/close error from Bterm
This commit is contained in:
parent
f7f0512875
commit
4af8158b53
1 changed files with 5 additions and 3 deletions
|
|
@ -141,13 +141,15 @@ Bopen(char *name, int mode)
|
||||||
int
|
int
|
||||||
Bterm(Biobuf *bp)
|
Bterm(Biobuf *bp)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
deinstall(bp);
|
deinstall(bp);
|
||||||
Bflush(bp);
|
ret = Bflush(bp);
|
||||||
if(bp->flag == Bmagic) {
|
if(bp->flag == Bmagic) {
|
||||||
bp->flag = 0;
|
bp->flag = 0;
|
||||||
close(bp->fid);
|
if(close(bp->fid) < 0)
|
||||||
|
ret = -1;
|
||||||
free(bp);
|
free(bp);
|
||||||
}
|
}
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue