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

* ext/socket/socket.c (sock_s_socketpair): try GC only once.

[ruby-dev:28778]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2006-06-21 20:19:07 +00:00
parent 1b5d98f3aa
commit 84438a5cc3
2 changed files with 14 additions and 7 deletions

View file

@ -1,3 +1,8 @@
Thu Jun 22 05:15:58 2006 Tanaka Akira <akr@m17n.org>
* ext/socket/socket.c (sock_s_socketpair): try GC only once.
[ruby-dev:28778]
Wed Jun 21 21:28:32 2006 Tadayoshi Funaba <tadf@dotrb.org> Wed Jun 21 21:28:32 2006 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb (jd_to_commercial): now works fine even if in * lib/date.rb (jd_to_commercial): now works fine even if in

View file

@ -2304,15 +2304,17 @@ sock_s_socketpair(klass, domain, type, protocol)
VALUE klass, domain, type, protocol; VALUE klass, domain, type, protocol;
{ {
#if defined HAVE_SOCKETPAIR #if defined HAVE_SOCKETPAIR
int d, t, sp[2]; int d, t, p, sp[2];
int ret;
setup_domain_and_type(domain, &d, type, &t); setup_domain_and_type(domain, &d, type, &t);
again: p = NUM2INT(protocol);
if (socketpair(d, t, NUM2INT(protocol), sp) < 0) { ret = socketpair(d, t, p, sp);
if (errno == EMFILE || errno == ENFILE) { if (ret < 0 && (errno == EMFILE || errno == ENFILE)) {
rb_gc(); rb_gc();
goto again; ret = socketpair(d, t, p, sp);
} }
if (ret < 0) {
rb_sys_fail("socketpair(2)"); rb_sys_fail("socketpair(2)");
} }