diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-21 07:06:27 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-21 07:06:27 +0000 |
commit | 4791b2bc2289e36c33c7ba0e2c9f09a5f509f28d (patch) | |
tree | 00624764806a2081d6988a8553523d1cbe190721 /ruby.c | |
parent | 0ce605225fff11cb30e679958f39dfe1e7f4b1dd (diff) | |
download | ruby-4791b2bc2289e36c33c7ba0e2c9f09a5f509f28d.tar.gz |
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
Diffstat (limited to 'ruby.c')
-rw-r--r-- | ruby.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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); |