summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-10-04 23:12:25 -0700
committerOri Bernstein <ori@eigenstate.org>2015-10-04 23:12:25 -0700
commit35ae688b88cdb8952a456f0794af576773613907 (patch)
treeaf1e8dfa715a28f51193c0c8d2d7e5adef5345ed
parentb33507bdac290ffd2792dafeb7b73f81cb4cda8d (diff)
downloadmc-35ae688b88cdb8952a456f0794af576773613907.tar.gz
Drop buffer on flush error.
We don't want to end up with the buffers left while in an error state.
-rw-r--r--lib/bio/bio.myr8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/bio/bio.myr b/lib/bio/bio.myr
index eae9137..f9517ca 100644
--- a/lib/bio/bio.myr
+++ b/lib/bio/bio.myr
@@ -246,13 +246,11 @@ const flush = {f
ret = true
if f.mode & Wr != 0
match writebuf(f.fd, f.wbuf[:f.wend])
- | `Ok n:
- ret = (n == f.wend)
- f.wend = 0
- | _:
- -> false
+ | `Ok n: ret = (n == f.wend)
+ | _: ret = false
;;
;;
+ f.wend = 0
-> ret
}