diff options
author | Russ Cox <rsc@swtch.com> | 2019-12-19 14:49:35 -0500 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2019-12-19 14:49:35 -0500 |
commit | 4af8158b5351cc0ed7fc0ebb5e7b31c64069363d (patch) | |
tree | 3967a5737dad187ca334b78e2c580bd9fd277bc9 /src/libbio | |
parent | f7f0512875f6eedfa8caa26a4b3969d66f31a6c4 (diff) | |
download | plan9port-4af8158b5351cc0ed7fc0ebb5e7b31c64069363d.tar.gz plan9port-4af8158b5351cc0ed7fc0ebb5e7b31c64069363d.tar.bz2 plan9port-4af8158b5351cc0ed7fc0ebb5e7b31c64069363d.zip |
libbio: report Bflush/close error from Bterm
Diffstat (limited to 'src/libbio')
-rw-r--r-- | src/libbio/binit.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libbio/binit.c b/src/libbio/binit.c index 8ec375ce..95a70a28 100644 --- a/src/libbio/binit.c +++ b/src/libbio/binit.c @@ -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; } |