Module Signal |
In: | lib/phusion_passenger/utils.rb

Methods

- list_trappable

Public Class methods
list_trappable()

Like Signal.list, but only returns signals that we can actually trap.

[ show source ]

          # File lib/phusion_passenger/utils.rb, line 1008
    1008:         def self.list_trappable
    1009:                 ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"
    1010:                 case ruby_engine
    1011:                 when "ruby"
    1012:                         result = Signal.list
    1013:                         result.delete("ALRM")
    1014:                         result.delete("VTALRM")
    1015:                 when "jruby"
    1016:                         result = Signal.list
    1017:                         result.delete("QUIT")
    1018:                         result.delete("ILL")
    1019:                         result.delete("FPE")
    1020:                         result.delete("KILL")
    1021:                         result.delete("SEGV")
    1022:                         result.delete("USR1")
    1023:                 else
    1024:                         result = Signal.list
    1025:                 end
    1026:
    1027:                 # Don't touch SIGCHLD no matter what! On OS X waitpid() will
    1028:                 # malfunction if SIGCHLD doesn't have a correct handler.
    1029:                 result.delete("CLD")
    1030:                 result.delete("CHLD")
    1031:
    1032:                 # Other stuff that we don't want to trap no matter which
    1033:                 # Ruby engine.
    1034:                 result.delete("STOP")
    1035:
    1036:                 return result
    1037:         end