aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/file
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-09-14 09:44:29 +0200
committerMichael Koziarski <michael@koziarski.com>2008-09-14 09:44:29 +0200
commitd28c724b4074605445d2834888ad280778f0af6a (patch)
tree2804f2bedec19cb4d5ad91ca534f08bc57a715ae /activesupport/lib/active_support/core_ext/file
parenta17027d13a48e1e64b14a28e7d58e341812f8cb4 (diff)
downloadrails-d28c724b4074605445d2834888ad280778f0af6a.tar.gz
rails-d28c724b4074605445d2834888ad280778f0af6a.tar.bz2
rails-d28c724b4074605445d2834888ad280778f0af6a.zip
Make sure the permissions check file is closed before being unlinked.
[#1035 state:committed]
Diffstat (limited to 'activesupport/lib/active_support/core_ext/file')
-rw-r--r--activesupport/lib/active_support/core_ext/file/atomic.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/file/atomic.rb b/activesupport/lib/active_support/core_ext/file/atomic.rb
index 4d3cf5423f..f988eff3d9 100644
--- a/activesupport/lib/active_support/core_ext/file/atomic.rb
+++ b/activesupport/lib/active_support/core_ext/file/atomic.rb
@@ -28,7 +28,7 @@ module ActiveSupport #:nodoc:
rescue Errno::ENOENT
# No old permissions, write a temp file to determine the defaults
check_name = ".permissions_check.#{Thread.current.object_id}.#{Process.pid}.#{rand(1000000)}"
- new(check_name, "w")
+ open(check_name, "w") { }
old_stat = stat(check_name)
unlink(check_name)
end