[前][次][番号順一覧][スレッド一覧]

ruby-changes:18018

From: yugui <ko1@a...>
Date: Thu, 2 Dec 2010 17:07:16 +0900 (JST)
Subject: [ruby-changes:18018] Ruby:r30039 (ruby_1_9_2): merges r29449 from trunk into ruby_1_9_2.

yugui	2010-12-02 17:06:52 +0900 (Thu, 02 Dec 2010)

  New Revision: 30039

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30039

  Log:
    merges r29449 from trunk into ruby_1_9_2.
    --
    * win32/win32.c (rb_w32_strerror): unmap some range of errno for
      workaround of VC10's strerror() and sys_nerr problem.
      based on a patch from Akio Tajima, [ruby-dev:42355].

  Modified files:
    branches/ruby_1_9_2/ChangeLog
    branches/ruby_1_9_2/version.h
    branches/ruby_1_9_2/win32/win32.c

Index: ruby_1_9_2/ChangeLog
===================================================================
--- ruby_1_9_2/ChangeLog	(revision 30038)
+++ ruby_1_9_2/ChangeLog	(revision 30039)
@@ -1,3 +1,9 @@
+Tue Oct 12 15:52:35 2010  NAKAMURA Usaku  <usa@r...>
+
+	* win32/win32.c (rb_w32_strerror): unmap some range of errno for
+	  workaround of VC10's strerror() and sys_nerr problem.
+	  based on a patch from Akio Tajima, [ruby-dev:42355].
+
 Tue Oct 12 15:36:09 2010  NARUSE, Yui  <naruse@r...>
 
 	* io.c (rb_io_ungetc): use unsigned int for GB18030.
Index: ruby_1_9_2/win32/win32.c
===================================================================
--- ruby_1_9_2/win32/win32.c	(revision 30038)
+++ ruby_1_9_2/win32/win32.c	(revision 30039)
@@ -2174,6 +2174,21 @@
     if (e < 0 || e > sys_nerr) {
 	if (e < 0)
 	    e = GetLastError();
+#if WSAEWOULDBLOCK != EWOULDBLOCK
+	else if (e >= EADDRINUSE && e <= EWOULDBLOCK) {
+	    static int s = -1;
+	    int i;
+	    if (s < 0)
+		for (s = 0; s < (int)(sizeof(errmap)/sizeof(*errmap)); s++)
+		    if (errmap[s].winerr == WSAEWOULDBLOCK)
+			break;
+	    for (i = s; i < (int)(sizeof(errmap)/sizeof(*errmap)); i++)
+		if (errmap[i].err == e) {
+		    e = errmap[i].winerr;
+		    break;
+		}
+	}
+#endif
 	if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
 			  FORMAT_MESSAGE_IGNORE_INSERTS, &source, e, 0,
 			  buffer, sizeof(buffer), NULL) == 0)
Index: ruby_1_9_2/version.h
===================================================================
--- ruby_1_9_2/version.h	(revision 30038)
+++ ruby_1_9_2/version.h	(revision 30039)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 69
+#define RUBY_PATCHLEVEL 70
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]