Permalink
Browse files

When trapping signals in Ruby, never trap SIGCHLD because waitpid() o…

…n OS X will malfunction if SIGCHLD doesn't have a correct handler.
  • Loading branch information...
FooBarWidget committed Dec 3, 2009
1 parent 0a9c7b3 commit 3a5f21e3108d2763d9bcbe67c2dd7df8f756343d
Showing with 12 additions and 4 deletions.
  1. +12 −4 lib/phusion_passenger/utils.rb
@@ -559,20 +559,28 @@ def self.list_trappable
result = Signal.list
result.delete("ALRM")
result.delete("VTALRM")
- return result
when "jruby"
result = Signal.list
result.delete("QUIT")
result.delete("ILL")
result.delete("FPE")
result.delete("KILL")
result.delete("SEGV")
- result.delete("STOP")
result.delete("USR1")
- return result
else
- return Signal.list
+ result = Signal.list
end
+
+ # Don't touch SIGCHLD no matter what! On OS X waitpid() will
+ # malfunction if SIGCHLD doesn't have a correct handler.
+ result.delete("CLD")
+ result.delete("CHLD")
+
+ # Other stuff that we don't want to trap no matter which
+ # Ruby engine.
+ result.delete("STOP")
+
+ return result
end
end

0 comments on commit 3a5f21e

Please sign in to comment.