diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-14 05:43:01 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-14 05:43:01 +0000 |
commit | 95ed081663af63b688f5094d2c454adb4e64f63f (patch) | |
tree | 1f414110b05c6f12ccdd358b42d49ab3d6c184b1 /lib/logger.rb | |
parent | 742659cb6c03da6ab61c7036a0ca6abdd5964119 (diff) |
logger.rb: fix extra log ratation
* lib/logger.rb (lock_shift_log): no need to rotate the log file
if it has been rotated by another process. based on the patch
by no6v (Nobuhiro IMAI) in [ruby-core:58620]. [Bug #9133]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/logger.rb')
-rw-r--r-- | lib/logger.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/logger.rb b/lib/logger.rb index c70b091469..3c50cb2313 100644 --- a/lib/logger.rb +++ b/lib/logger.rb @@ -644,8 +644,7 @@ private begin File.open(@filename, File::WRONLY | File::APPEND) do |lock| lock.flock(File::LOCK_EX) # inter-process locking. will be unlocked at closing file - ino = lock.stat.ino - if ino == File.stat(@filename).ino + if File.identical?(@filename, lock) and File.identical?(lock, @dev) yield # log shifting else # log shifted by another process (i-node before locking and i-node after locking are different) |