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

ruby-changes:10917

From: akr <ko1@a...>
Date: Sun, 22 Feb 2009 02:16:30 +0900 (JST)
Subject: [ruby-changes:10917] Ruby:r22492 (trunk): * ext/socket/ancdata.c (bsock_recvmsg_internal): handle EMSGSIZE as

akr	2009-02-22 02:16:18 +0900 (Sun, 22 Feb 2009)

  New Revision: 22492

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

  Log:
    * ext/socket/ancdata.c (bsock_recvmsg_internal): handle EMSGSIZE as
      well.

  Modified files:
    trunk/ChangeLog
    trunk/ext/socket/ancdata.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 22491)
+++ ChangeLog	(revision 22492)
@@ -1,3 +1,8 @@
+Sun Feb 22 02:15:40 2009  Tanaka Akira  <akr@f...>
+
+	* ext/socket/ancdata.c (bsock_recvmsg_internal): handle EMSGSIZE as
+	  well.
+
 Sun Feb 22 02:03:46 2009  Tanaka Akira  <akr@f...>
 
 	* ext/socket/ancdata.c (bsock_recvmsg_internal): check max length
Index: ext/socket/ancdata.c
===================================================================
--- ext/socket/ancdata.c	(revision 22491)
+++ ext/socket/ancdata.c	(revision 22492)
@@ -1298,8 +1298,13 @@
         if (nonblock && errno == EWOULDBLOCK)
             rb_sys_fail("recvmsg(2) WANT_READ");
 #if defined(HAVE_ST_MSG_CONTROL)
-        if (errno == EMFILE && !gc_done) {
-          /* SCM_RIGHTS hit the file descriptors limit, maybe. */
+        if (!gc_done && (errno == EMFILE || errno == EMSGSIZE)) {
+          /*
+           * When SCM_RIGHTS hit the file descriptors limit:
+           * - Linux 2.6.18 causes success with MSG_CTRUNC
+           * - MacOS X 10.4 causes EMSGSIZE (and lost file descriptors?)
+           * - Solaris 11 causes EMFILE
+           */
           gc_and_retry:
             rb_gc();
             gc_done = 1;

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

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