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 @@ -140,10 +140,18 @@ PHP_MSHUTDOWN_FUNCTION(pcntl)
140
140
PHP_RSHUTDOWN_FUNCTION (pcntl )
141
141
{
142
142
struct php_pcntl_pending_signal * sig ;
143
+ zend_long signo ;
144
+ zval * handle ;
145
+
146
+ /* Reset all signals to their default disposition */
147
+ ZEND_HASH_FOREACH_NUM_KEY_VAL (& PCNTL_G (php_signal_table ), signo , handle ) {
148
+ if (Z_TYPE_P (handle ) != IS_LONG || Z_LVAL_P (handle ) != (zend_long )SIG_DFL ) {
149
+ php_signal (signo , (Sigfunc * )(zend_long )SIG_DFL , 0 );
150
+ }
151
+ } ZEND_HASH_FOREACH_END ();
143
152
144
- /* FIXME: if a signal is delivered after this point, things will go pear shaped;
145
- * need to remove signal handlers */
146
153
zend_hash_destroy (& PCNTL_G (php_signal_table ));
154
+
147
155
while (PCNTL_G (head )) {
148
156
sig = PCNTL_G (head );
149
157
PCNTL_G (head ) = sig -> next ;
@@ -154,6 +162,7 @@ PHP_RSHUTDOWN_FUNCTION(pcntl)
154
162
PCNTL_G (spares ) = sig -> next ;
155
163
efree (sig );
156
164
}
165
+
157
166
return SUCCESS ;
158
167
}
159
168
You can’t perform that action at this time.
0 commit comments