diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-09-27 17:26:57 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-09-27 17:26:57 -0700 |
commit | 0d43e19396a325ac9fe8b6c0a6031c87c0202697 (patch) | |
tree | ac9d45c48c7d0f100fa2d25166e5d5250b5ba406 /lib | |
parent | dd400a46dc101bb679e173e37e79fa31d96b8acf (diff) | |
download | unicorn-0d43e19396a325ac9fe8b6c0a6031c87c0202697.tar.gz |
One less thing to RDoc
Diffstat (limited to 'lib')
-rw-r--r-- | lib/unicorn/util.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/unicorn/util.rb b/lib/unicorn/util.rb index 655a99d..6b35426 100644 --- a/lib/unicorn/util.rb +++ b/lib/unicorn/util.rb @@ -7,8 +7,6 @@ module Unicorn class Util class << self - APPEND_FLAGS = File::WRONLY | File::APPEND - # This reopens ALL logfiles in the process that have been rotated # using logrotate(8) (without copytruncate) or similar tools. # A +File+ object is considered for reopening if it is: @@ -19,10 +17,12 @@ module Unicorn # Returns the number of files reopened def reopen_logs nr = 0 + append_flags = File::WRONLY | File::APPEND + ObjectSpace.each_object(File) do |fp| next if fp.closed? next unless (fp.sync && fp.path[0..0] == "/") - next unless (fp.fcntl(Fcntl::F_GETFL) & APPEND_FLAGS) == APPEND_FLAGS + next unless (fp.fcntl(Fcntl::F_GETFL) & append_flags) == append_flags begin a, b = fp.stat, File.stat(fp.path) |