summaryrefslogtreecommitdiff
path: root/ext/pcntl/pcntl.c
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2015-01-26 11:52:53 +0100
committerOndřej Surý <ondrej@sury.org>2015-01-26 11:52:53 +0100
commit832b62efb8fceebb220116d8024d945a9bd31d7e (patch)
treee3c65d02b50180c7d7d7c21626d403d2eb87793a /ext/pcntl/pcntl.c
parent60fede4c90746ef3408ed27a15dd405b3a46a83b (diff)
downloadphp-upstream/5.6.5+dfsg.tar.gz
New upstream version 5.6.5+dfsgupstream/5.6.5+dfsg
Diffstat (limited to 'ext/pcntl/pcntl.c')
-rw-r--r--ext/pcntl/pcntl.c8
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;