mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
ext/socket/init.c (rsock_accept): handle ENOMEM
accept(2) documents ENOMEM as a possible error, handle it consistent with all of our other FD-allocating wrappers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
61e5fe0674
commit
d51743afc8
2 changed files with 5 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
Tue Nov 24 07:56:54 2015 Eric Wong <e@80x24.org>
|
||||
|
||||
* ext/socket/init.c (rsock_accept): handle ENOMEM
|
||||
|
||||
Tue Nov 24 07:50:15 2015 Eric Wong <e@80x24.org>
|
||||
|
||||
* dir.c (dir_initialize): use rb_gc_for_fd for ENOMEM
|
||||
|
|
|
@ -605,6 +605,7 @@ rsock_s_accept(VALUE klass, int fd, struct sockaddr *sockaddr, socklen_t *len)
|
|||
switch (errno) {
|
||||
case EMFILE:
|
||||
case ENFILE:
|
||||
case ENOMEM:
|
||||
if (retry) break;
|
||||
rb_gc();
|
||||
retry = 1;
|
||||
|
|
Loading…
Add table
Reference in a new issue