summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-27 14:51:08 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-27 14:51:08 +0000
commitc968f908e177e0a216dd6d0a45ee72b19a3b26a0 (patch)
treef192e64172a9589ffb7748fe5b2d4d11df32329c /lib
parent9ee98ff79894e70728c121c2182516883cb613f2 (diff)
* lib/cgi/core.rb: Use Tempfile#close(true) instead of Tempfile#unlink
to close file descriptors. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/cgi/core.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/cgi/core.rb b/lib/cgi/core.rb
index 241f817278..76b3a24b91 100644
--- a/lib/cgi/core.rb
+++ b/lib/cgi/core.rb
@@ -550,7 +550,7 @@ class CGI
name = $1 || $2 || ''
if body.original_filename.empty?
value=body.read.dup.force_encoding(@accept_charset)
- body.unlink if defined?(Tempfile) && body.kind_of?(Tempfile)
+ body.close(true) 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.unlink
+ t.close(true)
end
}
end