mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
IO.sysopen does retry. closes #26.
This commit is contained in:
+1
-8
@@ -13,14 +13,7 @@ class File < IO
|
||||
super(fd_or_path, mode)
|
||||
else
|
||||
@path = fd_or_path
|
||||
begin
|
||||
fd = IO.sysopen(@path, mode, perm)
|
||||
rescue RuntimeError => e
|
||||
raise FileError, "Could not open file (#{e})"
|
||||
rescue Errno::EMFILE, Errno::ENFILE
|
||||
GC.start
|
||||
fd = IO.sysopen(@path, mode, perm)
|
||||
end
|
||||
fd = IO.sysopen(@path, mode, perm)
|
||||
super(fd, mode)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user