summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--win32/win32.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index bb15c499d3..4e5aac7ab8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Nov 19 07:45:11 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_write): should set the error of
+ GetOverlappedResult()'s, not WriteFile()'s (it's always
+ ERROR_IO_PENDING, of course).
+
Tue Nov 18 14:16:47 2014 Koichi Sasada <ko1@atdot.net>
* gc.c (gc_record): add information for debug print.
diff --git a/win32/win32.c b/win32/win32.c
index 325954ec3e..b54ab744f8 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -6547,7 +6547,7 @@ rb_w32_write(int fd, const void *buf, size_t size)
if (!GetOverlappedResult((HANDLE)_osfhnd(fd), &ol, &written,
TRUE)) {
- errno = map_errno(err);
+ errno = map_errno(GetLastError());
CloseHandle(ol.hEvent);
cancel_io((HANDLE)_osfhnd(fd));
MTHREAD_ONLY(LeaveCriticalSection(&_pioinfo(fd)->lock));