[前][次][番号順一覧][スレッド一覧]

ruby-changes:51479

From: usa <ko1@a...>
Date: Mon, 18 Jun 2018 22:50:05 +0900 (JST)
Subject: [ruby-changes:51479] usa:r63689 (ruby_2_4): Fixed tempfile leaks

usa	2018-06-18 22:50:00 +0900 (Mon, 18 Jun 2018)

  New Revision: 63689

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63689

  Log:
    Fixed tempfile leaks
    
    * lib/rubygems.rb (Gem::VERSION): 2.6.14.2
    
    * lib/rubygems/ext/ext_conf_builder.rb: merge from 2.7.7.

  Modified files:
    branches/ruby_2_4/lib/rubygems/ext/ext_conf_builder.rb
    branches/ruby_2_4/lib/rubygems.rb
Index: ruby_2_4/lib/rubygems.rb
===================================================================
--- ruby_2_4/lib/rubygems.rb	(revision 63688)
+++ ruby_2_4/lib/rubygems.rb	(revision 63689)
@@ -10,7 +10,7 @@ require 'rbconfig' https://github.com/ruby/ruby/blob/trunk/ruby_2_4/lib/rubygems.rb#L10
 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
Index: ruby_2_4/lib/rubygems/ext/ext_conf_builder.rb
===================================================================
--- ruby_2_4/lib/rubygems/ext/ext_conf_builder.rb	(revision 63688)
+++ ruby_2_4/lib/rubygems/ext/ext_conf_builder.rb	(revision 63689)
@@ -27,9 +27,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ex https://github.com/ruby/ruby/blob/trunk/ruby_2_4/lib/rubygems/ext/ext_conf_builder.rb#L27
     # 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::Ex https://github.com/ruby/ruby/blob/trunk/ruby_2_4/lib/rubygems/ext/ext_conf_builder.rb#L35
         siteconf.puts "RbConfig::CONFIG['#{dir}'] = dest_path"
       end
 
-      siteconf.flush
+      siteconf.close
 
       destdir = ENV["DESTDIR"]
 
@@ -78,9 +76,9 @@ class Gem::Ext::ExtConfBuilder < Gem::Ex https://github.com/ruby/ruby/blob/trunk/ruby_2_4/lib/rubygems/ext/ext_conf_builder.rb#L76
         end
       ensure
         ENV["DESTDIR"] = destdir
+        siteconf.close!
       end
     end
-    t.unlink if t and t.path
 
     results
   ensure

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]