Skip to content

Commit

Permalink
Make sure the permissions check file is closed before being unlinked.
Browse files Browse the repository at this point in the history
[#1035 state:committed]
  • Loading branch information
NZKoz committed Sep 14, 2008
1 parent a17027d commit d28c724
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/core_ext/file/atomic.rb
Expand Up @@ -28,7 +28,7 @@ def atomic_write(file_name, temp_dir = Dir.tmpdir)
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
Expand Down

0 comments on commit d28c724

Please sign in to comment.