File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -485,10 +485,18 @@ PHP_MSHUTDOWN_FUNCTION(pcntl)
485
485
PHP_RSHUTDOWN_FUNCTION (pcntl )
486
486
{
487
487
struct php_pcntl_pending_signal * sig ;
488
+ zend_long signo ;
489
+ zval * handle ;
490
+
491
+ /* Reset all signals to their default disposition */
492
+ ZEND_HASH_FOREACH_NUM_KEY_VAL (& PCNTL_G (php_signal_table ), signo , handle ) {
493
+ if (Z_TYPE_P (handle ) != IS_LONG || Z_LVAL_P (handle ) != (zend_long )SIG_DFL ) {
494
+ php_signal (signo , (Sigfunc * )(zend_long )SIG_DFL , 0 );
495
+ }
496
+ } ZEND_HASH_FOREACH_END ();
488
497
489
- /* FIXME: if a signal is delivered after this point, things will go pear shaped;
490
- * need to remove signal handlers */
491
498
zend_hash_destroy (& PCNTL_G (php_signal_table ));
499
+
492
500
while (PCNTL_G (head )) {
493
501
sig = PCNTL_G (head );
494
502
PCNTL_G (head ) = sig -> next ;
@@ -499,6 +507,7 @@ PHP_RSHUTDOWN_FUNCTION(pcntl)
499
507
PCNTL_G (spares ) = sig -> next ;
500
508
efree (sig );
501
509
}
510
+
502
511
return SUCCESS ;
503
512
}
504
513
You can’t perform that action at this time.
0 commit comments