summaryrefslogtreecommitdiffstats
path: root/win32
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-28 19:49:20 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-28 19:49:20 +0000
commit041116d94c4357564a362b4c2250abc3e869ba64 (patch)
treee616fa3e75a05e707de8fd4cb77545eba177dbc4 /win32
parenta3bdecd85fb34fb29e5d5f99fd063300d3b850b1 (diff)
downloadruby-041116d94c4357564a362b4c2250abc3e869ba64.tar.gz
ruby-041116d94c4357564a362b4c2250abc3e869ba64.tar.xz
ruby-041116d94c4357564a362b4c2250abc3e869ba64.zip
* win32/win32.c (rb_w32_read, rb_w32_write): more accurate handling
of wait result. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 7d5fbda63..ece432f0b 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));