diff options
-rw-r--r-- | lib/unicorn/http_server.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb index 2decd77..402f133 100644 --- a/lib/unicorn/http_server.rb +++ b/lib/unicorn/http_server.rb @@ -449,13 +449,14 @@ class Unicorn::HttpServer end self.reexec_pid = fork do - listener_fds = Hash[LISTENERS.map do |sock| + listener_fds = {} + LISTENERS.each do |sock| # IO#close_on_exec= will be available on any future version of # Ruby that sets FD_CLOEXEC by default on new file descriptors # ref: http://redmine.ruby-lang.org/issues/5041 sock.close_on_exec = false if sock.respond_to?(:close_on_exec=) - [ sock.fileno, sock ] - end] + listener_fds[sock.fileno] = sock + end ENV['UNICORN_FD'] = listener_fds.keys.join(',') Dir.chdir(START_CTX[:cwd]) cmd = [ START_CTX[0] ].concat(START_CTX[:argv]) |