summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-06 07:32:09 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-06 07:32:09 +0000
commita3fcbc971264031f618871b857f062598b0e52be (patch)
treee0d9a8ccae4186f49ecb115d9e5eec50e95325c0 /io.c
parent3f8c4ba70f9aaa401f1b943b7ab30e2685d7078e (diff)
merge revision(s) 33667:
* 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. [Backport #5592] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34436 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 69c3c9e6eb..794f6de60b 100644
--- a/io.c
+++ b/io.c
@@ -936,8 +936,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),