diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-28 19:49:20 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-28 19:49:20 +0000 |
commit | d2d37173e7803d6ceec22233a903eb26e0617151 (patch) | |
tree | e616fa3e75a05e707de8fd4cb77545eba177dbc4 | |
parent | d4afbe49f36f35ad1bf4f5f054c180973dc7521e (diff) | |
download | ruby-d2d37173e7803d6ceec22233a903eb26e0617151.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | win32/win32.c | 8 |
2 files changed, 11 insertions, 2 deletions
@@ -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. diff --git a/win32/win32.c b/win32/win32.c index 7d5fbda63a..ece432f0b0 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -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)); |