about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <bofh@yhbt.net>2023-06-01 23:58:10 +0000
committerEric Wong <bofh@yhbt.net>2023-06-05 09:17:18 +0000
commit320bd05941374339c3a493dabde3e692ffa2881e (patch)
tree380a769f73d828e6216d3edd277b0fa4a4674e6e
parentd947cb91cf9dbd65d48e497b2605b124571f77ad (diff)
downloadunicorn-320bd05941374339c3a493dabde3e692ffa2881e.tar.gz
This has been irrelevant since Ruby 1.9.0+, actually.
-rw-r--r--lib/unicorn/http_server.rb16
1 files changed, 0 insertions, 16 deletions
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb
index 3416808..0ba24d8 100644
--- a/lib/unicorn/http_server.rb
+++ b/lib/unicorn/http_server.rb
@@ -446,11 +446,6 @@ class Unicorn::HttpServer
       Dir.chdir(START_CTX[:cwd])
       cmd = [ START_CTX[0] ].concat(START_CTX[:argv])
 
-      # avoid leaking FDs we don't know about, but let before_exec
-      # unset FD_CLOEXEC, if anything else in the app eventually
-      # relies on FD inheritence.
-      close_sockets_on_exec(listener_fds)
-
       # exec(command, hash) works in at least 1.9.1+, but will only be
       # required in 1.9.4/2.0.0 at earliest.
       cmd << listener_fds
@@ -472,8 +467,6 @@ class Unicorn::HttpServer
     worker_info = [worker.nr, worker.to_io.fileno, worker.master.fileno]
     env['UNICORN_WORKER'] = worker_info.join(',')
 
-    close_sockets_on_exec(listener_fds)
-
     Process.spawn(env, START_CTX[0], *START_CTX[:argv], listener_fds)
   end
 
@@ -486,15 +479,6 @@ class Unicorn::HttpServer
     listener_fds
   end
 
-  def close_sockets_on_exec(sockets)
-    (3..1024).each do |io|
-      next if sockets.include?(io)
-      io = IO.for_fd(io) rescue next
-      io.autoclose = false
-      io.close_on_exec = true
-    end
-  end
-
   # forcibly terminate all workers that haven't checked in in timeout seconds.  The timeout is implemented using an unlinked File
   def murder_lazy_workers
     next_sleep = @timeout - 1