about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-04-01 21:34:32 -0700
committerEric Wong <normalperson@yhbt.net>2009-04-01 21:34:32 -0700
commita139c4c8e3555bc30b72fe05e6009da5cc37c280 (patch)
tree8cfda6ff29e5114888eb917d084caabb8a435fc8 /lib
parentac01d8c83b6a3e0d9d0883d9df17f45e208ac101 (diff)
downloadunicorn-a139c4c8e3555bc30b72fe05e6009da5cc37c280.tar.gz
The newly open file descriptors live on as fd=1
and fd=2 anyways, so there's no reason to keep
duplicates around.
Diffstat (limited to 'lib')
-rw-r--r--lib/unicorn.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb
index c1d68c1..c6a4e36 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -94,8 +94,8 @@ module Unicorn
       raise ArgumentError, "no listeners" if @listeners.empty?
       self.pid = @config[:pid]
       build_app! if @preload_app
-      $stderr.reopen(File.open(@stderr_path, "a")) if @stderr_path
-      $stdout.reopen(File.open(@stdout_path, "a")) if @stdout_path
+      File.open(@stderr_path, "a") { |fp| $stderr.reopen(fp) } if @stderr_path
+      File.open(@stdout_path, "a") { |fp| $stdout.reopen(fp) } if @stdout_path
       $stderr.sync = $stdout.sync = true
       spawn_missing_workers
       self