* win32/win32.c (rb_w32_read): fix an issue that $stdin.read doesn't

terminate by CTRL-C on Windows.
  [ruby-dev:45149] [Bug #5812]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shirosaki 2012-01-28 00:51:43 +00:00
Родитель bb65920642
Коммит a65f6649dd
2 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Sat Jan 28 09:33:33 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
* win32/win32.c (rb_w32_read): fix an issue that $stdin.read doesn't
terminate by CTRL-C on Windows.
[ruby-dev:45149] [Bug #5812]
Sat Jan 28 08:18:11 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
* test/ruby/test_thread.rb

Просмотреть файл

@ -5575,6 +5575,10 @@ rb_w32_read(int fd, void *buf, size_t size)
}
}
}
else {
err = GetLastError();
errno = map_errno(err);
}
if (pol) {
CloseHandle(ol.hEvent);
@ -5591,7 +5595,8 @@ rb_w32_read(int fd, void *buf, size_t size)
ret += read;
if (read >= len) {
buf = (char *)buf + read;
if (!(isconsole && len == 1 && (!islineinput || *((char *)buf - 1) == '\n')) && size > 0)
if (err != ERROR_OPERATION_ABORTED &&
!(isconsole && len == 1 && (!islineinput || *((char *)buf - 1) == '\n')) && size > 0)
goto retry;
}
if (read == 0)