ruby-changes:17604
From: usa <ko1@a...>
Date: Wed, 27 Oct 2010 15:08:43 +0900 (JST)
Subject: [ruby-changes:17604] Ruby:r29609 (trunk): * thread_win32.c (w32_error): should get error no only once, because
usa 2010-10-27 15:08:37 +0900 (Wed, 27 Oct 2010) New Revision: 29609 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29609 Log: * 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. Modified files: trunk/ChangeLog trunk/thread_win32.c Index: thread_win32.c =================================================================== --- thread_win32.c (revision 29608) +++ thread_win32.c (revision 29609) @@ -67,18 +67,19 @@ 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); Index: ChangeLog =================================================================== --- ChangeLog (revision 29608) +++ ChangeLog (revision 29609) @@ -1,3 +1,9 @@ +Wed Oct 27 15:07:19 2010 NAKAMURA Usaku <usa@r...> + + * 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@r...> * test/ruby/test_io.rb (TestIO#pipe): need to propagate exceptions -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/