* ext/socket/ancdata.c (bsock_recvmsg_internal): handle EMSGSIZE as
well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6b0f596719
commit
47c6ecfa64
@ -1,3 +1,8 @@
|
|||||||
|
Sun Feb 22 02:15:40 2009 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* ext/socket/ancdata.c (bsock_recvmsg_internal): handle EMSGSIZE as
|
||||||
|
well.
|
||||||
|
|
||||||
Sun Feb 22 02:03:46 2009 Tanaka Akira <akr@fsij.org>
|
Sun Feb 22 02:03:46 2009 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/socket/ancdata.c (bsock_recvmsg_internal): check max length
|
* ext/socket/ancdata.c (bsock_recvmsg_internal): check max length
|
||||||
|
@ -1298,8 +1298,13 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
|
|||||||
if (nonblock && errno == EWOULDBLOCK)
|
if (nonblock && errno == EWOULDBLOCK)
|
||||||
rb_sys_fail("recvmsg(2) WANT_READ");
|
rb_sys_fail("recvmsg(2) WANT_READ");
|
||||||
#if defined(HAVE_ST_MSG_CONTROL)
|
#if defined(HAVE_ST_MSG_CONTROL)
|
||||||
if (errno == EMFILE && !gc_done) {
|
if (!gc_done && (errno == EMFILE || errno == EMSGSIZE)) {
|
||||||
/* SCM_RIGHTS hit the file descriptors limit, maybe. */
|
/*
|
||||||
|
* 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:
|
gc_and_retry:
|
||||||
rb_gc();
|
rb_gc();
|
||||||
gc_done = 1;
|
gc_done = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user