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, rb_w32_write): more accurate handling

of wait result.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2008-08-28 19:49:20 +00:00
parent d4afbe49f3
commit d2d37173e7
2 changed files with 11 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Fri Aug 29 04:47:49 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (rb_w32_read, rb_w32_write): more accurate handling
of wait result.
Fri Aug 29 02:59:35 2008 Tanaka Akira <akr@fsij.org>
* transcode.c (econv_finish): new method.

View file

@ -4367,7 +4367,9 @@ rb_w32_read(int fd, void *buf, size_t size)
if (pol) {
wait = rb_w32_wait_events_blocking(&ol.hEvent, 1, INFINITE);
if (wait != WAIT_OBJECT_0) {
if (errno != EINTR)
if (wait == WAIT_OBJECT_0 + 1)
errno = EINTR;
else
errno = map_errno(GetLastError());
CloseHandle(ol.hEvent);
cancel_io((HANDLE)_osfhnd(fd));
@ -4471,7 +4473,9 @@ rb_w32_write(int fd, const void *buf, size_t size)
if (pol) {
wait = rb_w32_wait_events_blocking(&ol.hEvent, 1, INFINITE);
if (wait != WAIT_OBJECT_0) {
if (errno != EINTR)
if (wait == WAIT_OBJECT_0 + 1)
errno = EINTR;
else
errno = map_errno(GetLastError());
CloseHandle(ol.hEvent);
cancel_io((HANDLE)_osfhnd(fd));