aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index cc59b1bbdc..48b1025c63 100644
--- a/io.c
+++ b/io.c
@@ -751,7 +751,7 @@ io_binwrite(VALUE str, rb_io_t *fptr, int nosync)
len = RSTRING_LEN(str);
if ((n = len) <= 0) return n;
- if (fptr->wbuf == NULL && !(fptr->mode & FMODE_SYNC)) {
+ if (fptr->wbuf == NULL && !(!nosync && (fptr->mode & FMODE_SYNC))) {
fptr->wbuf_off = 0;
fptr->wbuf_len = 0;
fptr->wbuf_capa = 8192;