summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--lib/tempfile.rb26
2 files changed, 6 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index 19741886ae..a709cba33a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Dec 4 22:53:12 2011 Tanaka Akira <akr@fsij.org>
+
+ * lib/tempfile.rb: don't use lock directory. [ruby-dev:39197]
+
Sun Dec 4 22:34:43 2011 Tanaka Akira <akr@fsij.org>
* lib/tempfile.rb (Tempfile::MAX_TRY): remove unused constant.
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index 57fb228c13..a8f22c8eb6 100644
--- a/lib/tempfile.rb
+++ b/lib/tempfile.rb
@@ -140,10 +140,8 @@ class Tempfile < DelegateClass(File)
else
opts = perm
end
- self.class.locking(tmpname) do
- @data[1] = @tmpfile = File.open(tmpname, mode, opts)
- @data[0] = @tmpname = tmpname
- end
+ @data[1] = @tmpfile = File.open(tmpname, mode, opts)
+ @data[0] = @tmpname = tmpname
@mode = mode & ~(File::CREAT|File::EXCL)
perm or opts.freeze
@opts = opts
@@ -320,26 +318,6 @@ class Tempfile < DelegateClass(File)
tempfile
end
end
-
- # :stopdoc:
-
- # yields with locking for +tmpname+ and returns the result of the
- # block.
- def locking(tmpname)
- lock = tmpname + '.lock'
- mkdir(lock)
- yield
- ensure
- rmdir(lock) if lock
- end
-
- def mkdir(*args)
- Dir.mkdir(*args)
- end
-
- def rmdir(*args)
- Dir.rmdir(*args)
- end
end
end