1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/find.rb (Find.find): rescue more exceptions which is possible to

occur by other process change the directory tree.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2009-12-15 15:54:34 +00:00
parent d698bd8ad0
commit 9ab779aad1
2 changed files with 8 additions and 3 deletions

View file

@ -1,6 +1,11 @@
Wed Dec 16 00:53:14 2009 Tanaka Akira <akr@fsij.org>
* lib/find.rb (Find.find): rescue more exceptions which is possible to
occur by other process change the directory tree.
Tue Dec 15 09:06:33 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/find.rb (Find.find): get rid of race condition.
* lib/find.rb (Find.find): get rid of race condition.
Mon Dec 14 22:33:21 2009 Tanaka Akira <akr@fsij.org>

View file

@ -41,13 +41,13 @@ module Find
yield file.dup.taint
begin
s = File.lstat(file)
rescue Errno::ENOENT, Errno::EACCES
rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG
next
end
if s.directory? then
begin
fs = Dir.entries(file)
rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR
rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG
next
end
fs.sort!