From 032791b9a367f67febbe7534f6ea4cac127e7897 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 1 Oct 2012 21:18:02 -0700 Subject: util: only consider regular files as logs If a user specifies a non-regular file for stderr_path or stdout_path, we should not attempt to reopen or chown it. This should also allow users to specify FIFOs as log destinations. --- lib/unicorn/util.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/unicorn/util.rb b/lib/unicorn/util.rb index cde2563..f84241c 100644 --- a/lib/unicorn/util.rb +++ b/lib/unicorn/util.rb @@ -7,6 +7,7 @@ module Unicorn::Util append_flags = File::WRONLY | File::APPEND ! fp.closed? && + fp.stat.file? && fp.sync && (fp.fcntl(Fcntl::F_GETFL) & append_flags) == append_flags rescue IOError, Errno::EBADF -- cgit v1.2.3-24-ge0c7