diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-30 03:26:43 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-30 03:26:43 +0000 |
commit | e4288860d8ecbab35c31cdb6efff648c530ebf7a (patch) | |
tree | ac65ee21a2b1a8fdcce4b1ca4da130ac680d14c5 /win32 | |
parent | 80c21e35cb9660c5f10ee49ddc466866ed089e60 (diff) | |
download | ruby-e4288860d8ecbab35c31cdb6efff648c530ebf7a.tar.gz |
* win32/win32.c (rb_w32_read): read only 1 byte at once on console.
workaround of Windows bug. see [ruby-core:33460].
this is not the final solution.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/win32/win32.c b/win32/win32.c index 67160bdb71..3e1da087b9 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -5027,6 +5027,7 @@ rb_w32_read(int fd, void *buf, size_t size) size_t len; size_t ret; OVERLAPPED ol, *pol = NULL; + BOOL isconsole; int start = 0; if (is_socket(sock)) @@ -5049,11 +5050,12 @@ rb_w32_read(int fd, void *buf, size_t size) } ret = 0; + isconsole = is_console(_osfhnd(fd)); retry: /* get rid of console reading bug */ - if (is_console(_osfhnd(fd))) { + if (isconsole) { if (start) - len = min(16 * 1024, size); + len = 1; else { len = 0; start = 1; |