From d7d5fe8359348d08a301c67fc9b2a37dd105832b Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 21 Feb 2009 16:53:30 +0000 Subject: * ext/socket/ancdata.c (bsock_recvmsg_internal): don't call discard_cmsg_resource when EMFILE. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/socket/ancdata.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ext/socket') diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c index 5afd3d66e..28f00649d 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; -- cgit