1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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:
akr 2009-02-21 17:16:18 +00:00
parent 6b0f596719
commit 47c6ecfa64
2 changed files with 12 additions and 2 deletions

View file

@ -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>
* ext/socket/ancdata.c (bsock_recvmsg_internal): check max length

View file

@ -1298,8 +1298,13 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
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;