From c968f908e177e0a216dd6d0a45ee72b19a3b26a0 Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 27 May 2014 14:51:08 +0000 Subject: * 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 --- lib/cgi/core.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/cgi') 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 -- cgit v1.2.3