From d28c724b4074605445d2834888ad280778f0af6a Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Sun, 14 Sep 2008 09:44:29 +0200 Subject: Make sure the permissions check file is closed before being unlinked. [#1035 state:committed] --- activesupport/lib/active_support/core_ext/file/atomic.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/core_ext') 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 -- cgit v1.2.3