1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* win32/win32.c (rb_w32_read): retry with reduced length if cannot to

write any data but no error occurs.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2014-11-10 11:21:42 +00:00
parent 33bb38a644
commit 1b0cbb6ae0
2 changed files with 12 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Mon Nov 10 20:20:53 2014 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (rb_w32_read): retry with reduced length if cannot to
write any data but no error occurs.
Mon Nov 10 20:04:16 2014 Tanaka Akira <akr@fsij.org>
* lib/webrick/server.rb: Setup shutdown pipe in listen method.

View file

@ -6497,6 +6497,7 @@ rb_w32_write(int fd, const void *buf, size_t size)
/* get rid of console writing bug */
len = (_osfile(fd) & FDEV) ? min(32 * 1024, size) : size;
size -= len;
retry2:
/* if have cancel_io, use Overlapped I/O */
if (cancel_io) {
@ -6556,6 +6557,12 @@ rb_w32_write(int fd, const void *buf, size_t size)
goto retry;
}
if (ret == 0) {
size_t newlen = len / 2;
if (newlen > 0) {
size += len - newlen;
len = newlen;
goto retry2;
}
ret = -1;
errno = EWOULDBLOCK;
}