提交 d28c724b 编写于 作者: M Michael Koziarski

Make sure the permissions check file is closed before being unlinked.

[#1035 state:committed]
上级 a17027d1
...@@ -28,7 +28,7 @@ def atomic_write(file_name, temp_dir = Dir.tmpdir) ...@@ -28,7 +28,7 @@ def atomic_write(file_name, temp_dir = Dir.tmpdir)
rescue Errno::ENOENT rescue Errno::ENOENT
# No old permissions, write a temp file to determine the defaults # No old permissions, write a temp file to determine the defaults
check_name = ".permissions_check.#{Thread.current.object_id}.#{Process.pid}.#{rand(1000000)}" 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) old_stat = stat(check_name)
unlink(check_name) unlink(check_name)
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册