diff --git a/ChangeLog b/ChangeLog index 481394ee82..259c604274 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Feb 22 01:52:30 2009 Tanaka Akira + + * ext/socket/ancdata.c (bsock_recvmsg_internal): don't call + discard_cmsg_resource when EMFILE. + Sun Feb 22 01:48:51 2009 Tanaka Akira * ext/socket/ancdata.c (bsock_recvmsg_internal): gc when SCM_RIGHTS diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c index 5afd3d66e2..28f00649d7 100644 --- a/ext/socket/ancdata.c +++ b/ext/socket/ancdata.c @@ -1301,7 +1301,6 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock) if (errno == EMFILE && !gc_done) { /* SCM_RIGHTS hit the file descriptors limit, maybe. */ gc_and_retry: - discard_cmsg_resource(&mh); rb_gc(); gc_done = 1; goto retry; @@ -1323,8 +1322,10 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock) mh.msg_controllen < maxctllen - BIG_ENOUGH_SPACE) { /* there are big space bug truncated. * file descriptors limit? */ - if (!gc_done) + if (!gc_done) { + discard_cmsg_resource(&mh); goto gc_and_retry; + } } else { maxctllen *= 2;