From 36888441021fbb0ae0cf724dc4e700d316b4d1bd Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 27 Dec 2009 19:38:39 -0800 Subject: Avoid leaking ready pipe file descriptor to workers Otherwise the original spawner process may not notice the close as it's still being shared by workers. While we're at it, avoid confusing the original spawner by using readpartial instead of sysread. --- lib/unicorn/launcher.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/unicorn/launcher.rb') diff --git a/lib/unicorn/launcher.rb b/lib/unicorn/launcher.rb index 2d6ad97..0ea836b 100644 --- a/lib/unicorn/launcher.rb +++ b/lib/unicorn/launcher.rb @@ -42,7 +42,7 @@ class Unicorn::Launcher if grandparent == $$ # this will block until HttpServer#join runs (or it dies) - master_pid = rd.sysread(16).to_i + master_pid = rd.readpartial(16).to_i exit!(1) unless master_pid > 1 exit 0 else # unicorn master process -- cgit v1.2.3-24-ge0c7