From 69105a1724d5223025fa35488cb860f90f2cba1d Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 30 May 2014 14:50:42 +0000 Subject: Close FDs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/webrick/test_filehandler.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'test/webrick/test_filehandler.rb') diff --git a/test/webrick/test_filehandler.rb b/test/webrick/test_filehandler.rb index 10b6add147..bdbd4e26fa 100644 --- a/test/webrick/test_filehandler.rb +++ b/test/webrick/test_filehandler.rb @@ -14,10 +14,15 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase end def get_res_body(res) - if defined? res.body.read - res.body.read + body = res.body + if defined? body.read + begin + body.read + ensure + body.close + end else - res.body + body end end -- cgit v1.2.3