diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-05-02 22:43:22 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-05-22 01:54:20 -0700 |
commit | df330c00577fed3c16be92129891f08f56441aef (patch) | |
tree | 4956bfd0298f45db2a0c071df130c5f469018498 | |
parent | 772127fca59290327344e3851cbf5b0e5a4ce2df (diff) | |
download | unicorn-df330c00577fed3c16be92129891f08f56441aef.tar.gz |
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.rb | 6 |
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 |