ruby-changes:39114
From: nobu <ko1@a...>
Date: Wed, 8 Jul 2015 20:36:24 +0900 (JST)
Subject: [ruby-changes:39114] nobu:r51195 (trunk): leakchecker.rb: close console
nobu 2015-07-08 20:35:59 +0900 (Wed, 08 Jul 2015) New Revision: 51195 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51195 Log: leakchecker.rb: close console * test/lib/leakchecker.rb (LeakChecker#find_fds): close console before find open FDs for each time. Modified files: trunk/test/lib/leakchecker.rb Index: test/lib/leakchecker.rb =================================================================== --- test/lib/leakchecker.rb (revision 51194) +++ test/lib/leakchecker.rb (revision 51195) @@ -17,6 +17,9 @@ class LeakChecker https://github.com/ruby/ruby/blob/trunk/test/lib/leakchecker.rb#L17 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 https://github.com/ruby/ruby/blob/trunk/test/lib/leakchecker.rb#L38 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? -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/