ruby-changes:21618
From: usa <ko1@a...>
Date: Tue, 8 Nov 2011 14:52:42 +0900 (JST)
Subject: [ruby-changes:21618] usa:r33667 (trunk): * io.c (io_fwrite): call rb_w32_write_console() only if FMODE_TTY is
usa 2011-11-08 14:52:32 +0900 (Tue, 08 Nov 2011) New Revision: 33667 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33667 Log: * 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. Modified files: trunk/ChangeLog trunk/io.c Index: ChangeLog =================================================================== --- ChangeLog (revision 33666) +++ ChangeLog (revision 33667) @@ -1,3 +1,9 @@ +Tue Nov 8 14:50:55 2011 NAKAMURA Usaku <usa@r...> + + * 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. + Tue Nov 8 11:01:04 2011 NARUSE, Yui <naruse@r...> * ext/pty/pty.c (get_device_once): FreeBSD's posix_openpt doesn't Index: io.c =================================================================== --- io.c (revision 33666) +++ io.c (revision 33667) @@ -1085,8 +1085,10 @@ 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), -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/