mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-24 11:41:58 +00:00
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
|
||||
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 a new issue