From 95ed081663af63b688f5094d2c454adb4e64f63f Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 14 Dec 2013 05:43:01 +0000 Subject: 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 --- lib/logger.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib') 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) -- cgit v1.2.3