diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-06-18 13:50:00 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-06-18 13:50:00 +0000 |
commit | 235700b18069026db3f1b39e43c234323156530c (patch) | |
tree | a59d4239d443836e601955a0bd2f8f5bd3d95328 | |
parent | bd4ba72a2504ae0123b562cf9203f854837d623c (diff) |
Fixed tempfile leaks
* lib/rubygems.rb (Gem::VERSION): 2.6.14.2
* lib/rubygems/ext/ext_conf_builder.rb: merge from 2.7.7.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@63689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | lib/rubygems.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/ext/ext_conf_builder.rb | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb index a5a9202e56..53be979a52 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -10,7 +10,7 @@ require 'rbconfig' require 'thread' module Gem - VERSION = "2.6.14.1" + VERSION = "2.6.14.2" end # Must be first since it unloads the prelude from 1.9.2 diff --git a/lib/rubygems/ext/ext_conf_builder.rb b/lib/rubygems/ext/ext_conf_builder.rb index b6dde01950..965b728278 100644 --- a/lib/rubygems/ext/ext_conf_builder.rb +++ b/lib/rubygems/ext/ext_conf_builder.rb @@ -27,9 +27,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder # TODO: Make this unconditional when rubygems no longer supports Ruby 1.9.x. tmp_dest = get_relative_path(tmp_dest) unless Gem.win_platform? && RUBY_VERSION <= '2.0' - t = nil Tempfile.open %w"siteconf .rb", "." do |siteconf| - t = siteconf siteconf.puts "require 'rbconfig'" siteconf.puts "dest_path = #{tmp_dest.dump}" %w[sitearchdir sitelibdir].each do |dir| @@ -37,7 +35,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder siteconf.puts "RbConfig::CONFIG['#{dir}'] = dest_path" end - siteconf.flush + siteconf.close destdir = ENV["DESTDIR"] @@ -78,9 +76,9 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder end ensure ENV["DESTDIR"] = destdir + siteconf.close! end end - t.unlink if t and t.path results ensure |