summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-23 12:51:39 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-23 12:51:39 +0000
commitc1759a9f18bf7349d7d8165b625deda5be5d20ca (patch)
treea792ef9e548a1b1f46bae72cf0b8785a6ed576b2 /io.c
parent0f1a1073f7c9ab1ac67975ec45faa8fe91c22671 (diff)
* io.c (io_binwrite): allocate wbuf if nosync.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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;