summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-08 05:52:32 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-08 05:52:32 +0000
commit53881a8c6dc2ca658244d8f12952b732f98dd737 (patch)
treed4aaa03f793e3bd264d9d58a7a98547b934a34d4 /io.c
parent1b79efbb3945e59fb784a0ca23587e8ec5644777 (diff)
* io.c (io_fwrite): call rb_w32_write_console() only if FMODE_TTY is
set. this is the one of the reason of IO writing slowness of Windows in 1.9.3 or later. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/io.c b/io.c
index 7996c06382..a2b96bad6b 100644
--- a/io.c
+++ b/io.c
@@ -1085,8 +1085,10 @@ static long
io_fwrite(VALUE str, rb_io_t *fptr, int nosync)
{
#ifdef _WIN32
- long len = rb_w32_write_console(str, fptr->fd);
- if (len > 0) return len;
+ if (fptr->mode & FMODE_TTY) {
+ long len = rb_w32_write_console(str, fptr->fd);
+ if (len > 0) return len;
+ }
#endif
str = do_writeconv(str, fptr);
return io_binwrite(str, RSTRING_PTR(str), RSTRING_LEN(str),