Notes posted by wr0ngway

RSS feed
November 19, 2013
0 thanks

Return value not correct

It seems like trap returns nil if the handler was “DEFAULT”, but calling trap with nil causes a “IGNORE”

2.0.0-p247 :020 > p trap("CHLD", "DEFAULT")
nil
 => nil 
2.0.0-p247 :021 > p trap("CHLD", nil)
nil
 => nil 

So it seems that once you trap a signal, there isn’t a way to reset them back to what they were originally.