зеркало из https://github.com/github/ruby.git
* test/lib/minitest/unit.rb: Use Tempfile#close! instead of
Tempfile#unlink to close file descriptors. * test/openssl/test_config.rb: Ditto. * test/ruby/test_io.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
36276b6f40
Коммит
9b612d382d
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,12 @@
|
|||
Wed May 28 00:38:09 2014 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* test/lib/minitest/unit.rb: Use Tempfile#close! instead of
|
||||
Tempfile#unlink to close file descriptors.
|
||||
|
||||
* test/openssl/test_config.rb: Ditto.
|
||||
|
||||
* test/ruby/test_io.rb: Ditto.
|
||||
|
||||
Wed May 28 00:06:18 2014 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* lib/net/ftp.rb (transfercmd): Close TCP server socket even if an
|
||||
|
@ -5,7 +14,7 @@ Wed May 28 00:06:18 2014 Tanaka Akira <akr@fsij.org>
|
|||
|
||||
Tue May 27 23:50:07 2014 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* lib/cgi/core.rb: Use Tempfile#close(true) instead of Tempfile#unlink
|
||||
* lib/cgi/core.rb: Use Tempfile#close! instead of Tempfile#unlink
|
||||
to close file descriptors.
|
||||
|
||||
Tue May 27 23:06:46 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
|
|
@ -550,7 +550,7 @@ class CGI
|
|||
name = $1 || $2 || ''
|
||||
if body.original_filename.empty?
|
||||
value=body.read.dup.force_encoding(@accept_charset)
|
||||
body.close(true) if defined?(Tempfile) && body.kind_of?(Tempfile)
|
||||
body.close! if defined?(Tempfile) && body.kind_of?(Tempfile)
|
||||
(params[name] ||= []) << value
|
||||
unless value.valid_encoding?
|
||||
if @accept_charset_error_block
|
||||
|
@ -578,7 +578,7 @@ class CGI
|
|||
if tempfiles
|
||||
tempfiles.each {|t|
|
||||
if t.path
|
||||
t.close(true)
|
||||
t.close!
|
||||
end
|
||||
}
|
||||
end
|
||||
|
|
|
@ -1063,7 +1063,7 @@ module MiniTest
|
|||
list.each {|str|
|
||||
puts "Leaked tempfile: #{name}: #{str}"
|
||||
}
|
||||
tempfile_retained.each {|t| t.unlink }
|
||||
tempfile_retained.each {|t| t.close! }
|
||||
end
|
||||
live2
|
||||
end
|
||||
|
|
|
@ -17,7 +17,7 @@ __EOD__
|
|||
end
|
||||
|
||||
def teardown
|
||||
@tmpfile.unlink
|
||||
@tmpfile.close!
|
||||
end
|
||||
|
||||
def test_constants
|
||||
|
|
|
@ -1924,7 +1924,7 @@ class TestIO < Test::Unit::TestCase
|
|||
assert_raise(Errno::EBADF, feature2250) {t.close}
|
||||
end
|
||||
ensure
|
||||
t.unlink
|
||||
t.close!
|
||||
end
|
||||
|
||||
def test_autoclose_false_closed_by_finalizer
|
||||
|
@ -1940,7 +1940,7 @@ class TestIO < Test::Unit::TestCase
|
|||
assert_nothing_raised(Errno::EBADF, feature2250) {t.close}
|
||||
end
|
||||
ensure
|
||||
t.unlink
|
||||
t.close!
|
||||
end
|
||||
|
||||
def test_open_redirect
|
||||
|
@ -2366,7 +2366,7 @@ End
|
|||
}
|
||||
ensure
|
||||
GC.start
|
||||
t.unlink
|
||||
t.close!
|
||||
end
|
||||
|
||||
def test_flush_in_finalizer2
|
||||
|
@ -2382,7 +2382,7 @@ End
|
|||
assert_nothing_raised(TypeError, bug3910) do
|
||||
GC.start
|
||||
end
|
||||
t.unlink
|
||||
t.close!
|
||||
}
|
||||
end
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче