diff options
Diffstat (limited to 'ext/pcntl/pcntl.c')
-rw-r--r-- | ext/pcntl/pcntl.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index b7ef4c729..1ee8ba799 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -878,6 +878,7 @@ PHP_FUNCTION(pcntl_signal) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error assigning signal"); RETURN_FALSE; } + zend_hash_index_del(&PCNTL_G(php_signal_table), signo); RETURN_TRUE; } @@ -1224,6 +1225,7 @@ static void pcntl_signal_handler(int signo) PCNTL_G(head) = psig; } PCNTL_G(tail) = psig; + PCNTL_G(pending_signals) = 1; } void pcntl_signal_dispatch() @@ -1233,6 +1235,10 @@ void pcntl_signal_dispatch() sigset_t mask; sigset_t old_mask; TSRMLS_FETCH(); + + if(!PCNTL_G(pending_signals)) { + return; + } /* Mask all signals */ sigfillset(&mask); @@ -1272,6 +1278,8 @@ void pcntl_signal_dispatch() queue = next; } + PCNTL_G(pending_signals) = 0; + /* Re-enable queue */ PCNTL_G(processing_signal_queue) = 0; |