diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ruby.c | 8 |
2 files changed, 12 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Fri Oct 21 16:06:25 2016 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * ruby.c (open_load_file): retry after GC when the limit for open + file descriptors reached. + Fri Oct 21 11:34:17 2016 Pascal Schmid <Lechindianer@users.noreply.github.com> * string.c (rb_str_sub, rb_str_gsub): [DOC] 'backlash' should read @@ -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); |