diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-05-02 22:43:22 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-05-02 22:43:46 -0700 |
commit | 62496dd0d777356b90029518763501a4cd70a4e3 (patch) | |
tree | 1d4dad7312e58d6cd3b601fa8c0d432ac19b9c57 /lib/unicorn/app/exec_cgi.rb | |
parent | 309cf04cb78971370794ea60cc724bfd5421ca53 (diff) | |
download | unicorn-62496dd0d777356b90029518763501a4cd70a4e3.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.
Diffstat (limited to 'lib/unicorn/app/exec_cgi.rb')
-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 |