mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 21:49:06 +02:00
ruby.c: retry loading with GC
* ruby.c (open_load_file): retry after GC when the limit for open file descriptors reached. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0ce605225f
commit
4791b2bc22
2 changed files with 12 additions and 1 deletions
8
ruby.c
8
ruby.c
|
@ -1899,7 +1899,13 @@ open_load_file(VALUE fname_v, int *xflag)
|
|||
#endif
|
||||
|
||||
if ((fd = rb_cloexec_open(fname, mode, 0)) < 0) {
|
||||
rb_load_fail(fname_v, strerror(errno));
|
||||
int e = errno;
|
||||
if (!rb_gc_for_fd(e)) {
|
||||
rb_load_fail(fname_v, strerror(e));
|
||||
}
|
||||
if ((fd = rb_cloexec_open(fname, mode, 0)) < 0) {
|
||||
rb_load_fail(fname_v, strerror(errno));
|
||||
}
|
||||
}
|
||||
rb_update_max_fd(fd);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue