From f09f5bc32b54e9d2e9f594fd2a2358af0a0f999a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 8 Jun 2010 03:26:43 +0000 Subject: workaround IO#reopen bug in rbx when reopening logs IO#reopen in Rubinius seems to munge the O_APPEND flag when passed a path, however passing an actual IO object. However, at the system call level, everything is the same. ref: http://github.com/evanphx/rubinius/issues/347 --- lib/unicorn/util.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/unicorn/util.rb b/lib/unicorn/util.rb index 5ceda5c..458b6d7 100644 --- a/lib/unicorn/util.rb +++ b/lib/unicorn/util.rb @@ -57,7 +57,7 @@ module Unicorn open_arg << ":#{enc.to_s}" enc = fp.internal_encoding and open_arg << ":#{enc.to_s}" end - fp.reopen(fp.path, open_arg) + File.open(fp.path, 'ab') { |tmpfp| fp.reopen(tmpfp) } fp.sync = true new_st = fp.stat if orig_st.uid != new_st.uid || orig_st.gid != new_st.gid -- cgit v1.2.3-24-ge0c7