Permalink
Browse files

Catch Errno::ENFILE too.

When system file descriptor table is full, errno is set to
ENFILE instead of EMFILE.  They are similar but different.
  • Loading branch information...
tsahara committed Dec 13, 2013
1 parent 87d8782 commit 8cee36b1b58b7bc092d87b6c5482b654913ec4d4
Showing with 1 addition and 1 deletion.
  1. +1 −1 mrblib/file.rb
View
@@ -16,7 +16,7 @@ def initialize(fd_or_path, mode = "r", perm = 0666)
@path = fd_or_path
begin
fd = IO.sysopen(@path, mode, perm)
- rescue Errno::EMFILE
+ rescue Errno::EMFILE, Errno::ENFILE
GC.start
fd = IO.sysopen(@path, mode, perm)
end

0 comments on commit 8cee36b

Please sign in to comment.