From 966dee27d01b68283e80ea544c93f9a659145302 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 8 Oct 2009 20:28:00 -0700 Subject: fchmod heartbeat flips between 0/1 This is for compatibility with OpenBSD as reported by Jeremy Evans for Unicorn. --- lib/rainbows/thread_spawn.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/rainbows/thread_spawn.rb') diff --git a/lib/rainbows/thread_spawn.rb b/lib/rainbows/thread_spawn.rb index 7dcd2e4..613a3f0 100644 --- a/lib/rainbows/thread_spawn.rb +++ b/lib/rainbows/thread_spawn.rb @@ -17,7 +17,7 @@ module Rainbows init_worker_process(worker) threads = ThreadGroup.new alive = worker.tmp - nr = 0 + m = 0 limit = worker_connections # closing anything we IO.select on will raise EBADF @@ -28,7 +28,7 @@ module Rainbows while alive && master_pid == Process.ppid ret = begin - alive.chmod(nr += 1) + alive.chmod(m = 0 == m ? 1 : 0) IO.select(LISTENERS, nil, nil, timeout/2.0) or next rescue Errno::EINTR retry -- cgit v1.2.3-24-ge0c7