summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-05-02 22:43:22 -0700
committerEric Wong <normalperson@yhbt.net>2009-05-22 01:54:20 -0700
commitdf330c00577fed3c16be92129891f08f56441aef (patch)
tree4956bfd0298f45db2a0c071df130c5f469018498
parent772127fca59290327344e3851cbf5b0e5a4ce2df (diff)
Don't allow newly created IO objects to get GC'ed and
subsequently close(2)-ed.  We're not reopening the
{$std,STD}{in,out,err} variables since those can't be
trusted to have fileno 1, 2 and 3 respectively.
-rw-r--r--lib/unicorn/app/exec_cgi.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/unicorn/app/exec_cgi.rb b/lib/unicorn/app/exec_cgi.rb
index f5e7db9..d98b3e4 100644
--- a/lib/unicorn/app/exec_cgi.rb
+++ b/lib/unicorn/app/exec_cgi.rb
@@ -69,9 +69,9 @@ module Unicorn::App
       ENV['GATEWAY_INTERFACE'] = 'CGI/1.1'
       env.keys.grep(/^HTTP_/) { |key| ENV[key] = env[key] }
 
-      IO.new(0).reopen(inp)
-      IO.new(1).reopen(out)
-      IO.new(2).reopen(err)
+      a = IO.new(0).reopen(inp)
+      b = IO.new(1).reopen(out)
+      c = IO.new(2).reopen(err)
       exec(*@args)
     end