From d0c9f1aeb94397883197dd8ee0c600d3f18f9ac9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 4 Sep 2009 01:57:06 -0700 Subject: Redirect files in binary mode Avoid potential issues that can arise from logging any weird characters that may not be supported in the current encoding. --- lib/unicorn.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 88391f6..0916891 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -630,7 +630,7 @@ module Unicorn end def redirect_io(io, path) - File.open(path, 'a') { |fp| io.reopen(fp) } if path + File.open(path, 'ab') { |fp| io.reopen(fp) } if path io.sync = true end -- cgit v1.2.3-24-ge0c7