diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-13 03:10:49 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-13 03:10:49 +0000 |
commit | c94c6a1a1604f24f8388463849094676dac49568 (patch) | |
tree | 31843f9f334af69f1f19ea6e9e39b06e4212cdb6 /thread_win32.c | |
parent | 8022385ba4d7031031372846d62d686422c108ed (diff) | |
download | ruby-c94c6a1a1604f24f8388463849094676dac49568.tar.gz |
* thread_win32.c (w32_error): get English message first, instead
of system default. see [ruby-core:32765].
[experimental]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_win32.c')
-rw-r--r-- | thread_win32.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/thread_win32.c b/thread_win32.c index 1b15baed81..46764f0988 100644 --- a/thread_win32.c +++ b/thread_win32.c @@ -67,13 +67,20 @@ static void w32_error(const char *func) { LPVOID lpMsgBuf; - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) & lpMsgBuf, 0, NULL); + if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + 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(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) & lpMsgBuf, 0, NULL); rb_bug("%s: %s", func, (char*)lpMsgBuf); } |