unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* [PATCH] construct listener_fds Hash in 1.8 compatible way
@ 2013-11-01 14:12 Ernest W. Durbin III
  2013-11-01 16:50 ` Eric Wong
  2013-11-01 17:46 ` Hleb Valoshka
  0 siblings, 2 replies; 9+ messages in thread
From: Ernest W. Durbin III @ 2013-11-01 14:12 UTC (permalink / raw)
  To: mongrel-unicorn

This renables the ability for Ruby 1.8 environments to perform reexecs
---
 lib/unicorn/http_server.rb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb
index 2decd77..9a5795c 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 = Hash.new
+      LISTENERS.map 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])
-- 
1.8.4

_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-01-29 22:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20140129225250.10947.71973@sandbox56423.mailgun.org>
2014-01-29 22:54 ` [PATCH] construct listener_fds Hash in 1.8 compatible way Ernest W. Durbin III
2013-11-01 14:12 Ernest W. Durbin III
2013-11-01 16:50 ` Eric Wong
2013-11-01 17:04   ` Ernest W. Durbin III
2013-11-01 18:54     ` Eric Wong
2013-11-01 19:00       ` Ernest W. Durbin III
2013-11-01 17:46 ` Hleb Valoshka
2013-11-01 18:32   ` Ernest W. Durbin III
2013-11-01 18:49     ` Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).