summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-21 16:53:30 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-21 16:53:30 +0000
commitd7d5fe8359348d08a301c67fc9b2a37dd105832b (patch)
treea4c45cbb37334e7eec97170f5cff5707f38eab99 /ext
parent809664ee8ee68437c74982416b2e3b7b62ac6141 (diff)
downloadruby-d7d5fe8359348d08a301c67fc9b2a37dd105832b.tar.gz
ruby-d7d5fe8359348d08a301c67fc9b2a37dd105832b.tar.xz
ruby-d7d5fe8359348d08a301c67fc9b2a37dd105832b.zip
* 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
Diffstat (limited to 'ext')
-rw-r--r--ext/socket/ancdata.c5
1 files changed, 3 insertions, 2 deletions
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;