Fix #72409 - return previous handler#1952
Conversation
This patch addresses https://bugs.php.net/bug.php?id=72409 It does alter default behavior in a potentially BC-incompatable means. In the event someone was === true, the return value of pcntl_signal(). However, this change could be applied to master with small changes.
|
@bp1222 @krakjoe @dshafik Could we consider merging this for 7.1? It can't go into an prior version as it does have a BC break against |
|
It is a weird sitch. Since SIG_DFL, in signal.h is a functionptr, and pcntl is just casting it to a zend_long. I wouldn't want to have PHP's SIG_DFL be some arbitrary number to handle this case. However, we could just document that the return value will be false on error, true on first set, and callable when overriding. Does that involve some aspect of user management? Maybe. Not sure if ugly or not, but if $handler === true, we could assume SIG_DFL. But that's also a bit clunky. So I'd opt to leave it kindof as-is where if you set a callable, it'd return the callable, else true. |
|
I will re-write this to patch master .. as I assumed, it probably wouldn't want to be applied to the 5.6.x branches from the BC problem |
This patch addresses https://bugs.php.net/bug.php?id=72409
It does alter default behavior in a potentially BC-incompatable
means. In the event someone was === true, the return value
of pcntl_signal(). However, this change could be applied to
master with small changes.