1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/tmpdir.rb (Dir.mktmpdir): rolled back r24699. [ruby-dev:39193]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-08-29 03:16:56 +00:00
parent 2235d504b7
commit be41711465
2 changed files with 5 additions and 2 deletions

View file

@ -1,3 +1,7 @@
Sat Aug 29 12:16:47 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/tmpdir.rb (Dir.mktmpdir): rolled back r24699. [ruby-dev:39193]
Sat Aug 29 03:27:17 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> Sat Aug 29 03:27:17 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/tempfile.rb (Tempfile#make_tmpname): removed thread race * lib/tempfile.rb (Tempfile#make_tmpname): removed thread race

View file

@ -111,10 +111,9 @@ class Dir
end end
tmpdir ||= Dir.tmpdir tmpdir ||= Dir.tmpdir
t = Time.now.strftime("%Y%m%d") t = Time.now.strftime("%Y%m%d")
th = Thread.current.object_id.to_s(36)
n = nil n = nil
begin begin
path = "#{tmpdir}/#{prefix}#{t}-#{$$}-#{th}-#{rand(0x100000000).to_s(36)}" path = "#{tmpdir}/#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
path << "-#{n}" if n path << "-#{n}" if n
path << suffix path << suffix
Dir.mkdir(path, 0700) Dir.mkdir(path, 0700)