diff options
| author | Tomoyuki Sahara <[email protected]> | 2013-11-16 16:04:31 +0900 |
|---|---|---|
| committer | Tomoyuki Sahara <[email protected]> | 2013-11-16 16:04:31 +0900 |
| commit | 87d878292d16bddad811a5cfd897ba27884bec8c (patch) | |
| tree | d5ad043479752a0d9d7004a611b2035f3d2a12ce /mrblib | |
| parent | e44da8a6cc587ba729bbc4ace0ca164f656207d8 (diff) | |
| download | mruby-87d878292d16bddad811a5cfd897ba27884bec8c.tar.gz mruby-87d878292d16bddad811a5cfd897ba27884bec8c.zip | |
Try GC when Too many open files (revert a part of 1e8097a).
Diffstat (limited to 'mrblib')
| -rw-r--r-- | mrblib/file.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mrblib/file.rb b/mrblib/file.rb index 243549cbb..048fbae80 100644 --- a/mrblib/file.rb +++ b/mrblib/file.rb @@ -14,7 +14,12 @@ class File < IO super(fd_or_path, mode) else @path = fd_or_path - fd = IO.sysopen(@path, mode, perm) + begin + fd = IO.sysopen(@path, mode, perm) + rescue Errno::EMFILE + GC.start + fd = IO.sysopen(@path, mode, perm) + end super(fd, mode) end end |
