aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-27 06:08:37 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-27 06:08:37 +0000
commitf30e1877b2402f9a92c6c1db12fed05b88ebaba1 (patch)
tree367e382806fce7e6f740e14cf7a1bbbadaf3d799
parentc265d57595a1d799c433de2422aeaa22f7ab5706 (diff)
downloadruby-f30e1877b2402f9a92c6c1db12fed05b88ebaba1.tar.gz
* thread_win32.c (w32_error): should get error no only once, because
the result of the second getting will indicate the error of the first FormatMessage() call. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--thread_win32.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 94c136c39f..ab3338da79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Oct 27 15:07:19 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * thread_win32.c (w32_error): should get error no only once, because
+ the result of the second getting will indicate the error of the
+ first FormatMessage() call.
+
Wed Oct 27 13:51:25 2010 NAKAMURA Usaku <usa@ruby-lang.org>
* test/ruby/test_io.rb (TestIO#pipe): need to propagate exceptions
diff --git a/thread_win32.c b/thread_win32.c
index d9f006a995..dc0b236328 100644
--- a/thread_win32.c
+++ b/thread_win32.c
@@ -67,18 +67,19 @@ static void
w32_error(const char *func)
{
LPVOID lpMsgBuf;
+ DWORD err = GetLastError();
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
- GetLastError(),
+ err,
MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
(LPTSTR) & lpMsgBuf, 0, NULL) == 0)
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
- GetLastError(),
+ err,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) & lpMsgBuf, 0, NULL);
rb_bug("%s: %s", func, (char*)lpMsgBuf);