From 0d43e19396a325ac9fe8b6c0a6031c87c0202697 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 27 Sep 2009 17:26:57 -0700 Subject: util: remove APPEND_FLAGS constant One less thing to RDoc --- lib/unicorn/util.rb | 6 +++--- 1 file 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) -- cgit v1.2.3-24-ge0c7