1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

leakchecker.rb: close console

* test/lib/leakchecker.rb (LeakChecker#find_fds): close console
  before find open FDs for each time.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-07-08 11:35:59 +00:00
parent 6c3d366bbc
commit 39051ba1b9

View file

@ -17,6 +17,9 @@ class LeakChecker
end
def find_fds
if IO.respond_to?(:console) and (m = IO.method(:console)).arity.nonzero?
m[:close]
end
fd_dir = "/proc/self/fd"
if File.directory?(fd_dir)
fds = Dir.open(fd_dir) {|d|
@ -35,9 +38,6 @@ class LeakChecker
def check_fd_leak(test_name)
leaked = false
live1 = @fd_info
if IO.respond_to?(:console) and (m = IO.method(:console)).arity.nonzero?
m[:close]
end
live2 = find_fds
fd_closed = live1 - live2
if !fd_closed.empty?