about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/unicorn/app/exec_cgi.rb6
-rw-r--r--lib/unicorn/http_server.rb1
-rw-r--r--lib/unicorn/tee_input.rb2
3 files changed, 4 insertions, 5 deletions
diff --git a/lib/unicorn/app/exec_cgi.rb b/lib/unicorn/app/exec_cgi.rb
index f7b4249..c259403 100644
--- a/lib/unicorn/app/exec_cgi.rb
+++ b/lib/unicorn/app/exec_cgi.rb
@@ -85,9 +85,9 @@ module Unicorn::App
       ENV['GATEWAY_INTERFACE'] = 'CGI/1.1'
       env.keys.grep(/^HTTP_/) { |key| ENV[key] = env[key] }
 
-      a = IO.new(0).reopen(inp)
-      b = IO.new(1).reopen(out)
-      c = IO.new(2).reopen(err)
+      $stdin.reopen(inp)
+      $stdout.reopen(out)
+      $stderr.reopen(err)
       exec(*args)
     end
 
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb
index 3a6e51e..3a35d7d 100644
--- a/lib/unicorn/http_server.rb
+++ b/lib/unicorn/http_server.rb
@@ -424,7 +424,6 @@ class Unicorn::HttpServer
 
     if pid
       old_pid = "#{pid}.oldbin"
-      prev_pid = pid.dup
       begin
         self.pid = old_pid  # clear the path for a new pid file
       rescue ArgumentError
diff --git a/lib/unicorn/tee_input.rb b/lib/unicorn/tee_input.rb
index a038a84..6d37f87 100644
--- a/lib/unicorn/tee_input.rb
+++ b/lib/unicorn/tee_input.rb
@@ -118,7 +118,7 @@ private
   end
 
   def tee(buffer)
-    if buffer && (n = buffer.size) > 0
+    if buffer && buffer.size > 0
       @tmp.write(buffer)
       @tmp.seek(0, IO::SEEK_END) # workaround FreeBSD/OSX + MRI 1.8.x bug
     end