summaryrefslogtreecommitdiff
path: root/ext/pcntl/php_signal.c
diff options
context:
space:
mode:
authorArnaud Le Blanc <lbarnaud@php.net>2010-11-01 22:43:59 +0000
committerArnaud Le Blanc <lbarnaud@php.net>2010-11-01 22:43:59 +0000
commit3ac257f344987fc5bba7357198feff90d608daeb (patch)
treecdc3e68c3c385fe5bbdb47b2775293f34a058de9 /ext/pcntl/php_signal.c
parentcd639862839cccf35d3a5326c4a73d76202efd25 (diff)
downloadphp-git-3ac257f344987fc5bba7357198feff90d608daeb.tar.gz
MFH fixed bug #52784 (Race condition when handling many
concurrent signals)
Diffstat (limited to 'ext/pcntl/php_signal.c')
-rw-r--r--ext/pcntl/php_signal.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/ext/pcntl/php_signal.c b/ext/pcntl/php_signal.c
index 6963e6ff37..d3f86d0f12 100644
--- a/ext/pcntl/php_signal.c
+++ b/ext/pcntl/php_signal.c
@@ -22,11 +22,15 @@
/* php_signal using sigaction is derrived from Advanced Programing
* in the Unix Environment by W. Richard Stevens p 298. */
-Sigfunc *php_signal(int signo, Sigfunc *func, int restart)
+Sigfunc *php_signal4(int signo, Sigfunc *func, int restart, int mask_all)
{
struct sigaction act,oact;
act.sa_handler = func;
- sigemptyset(&act.sa_mask);
+ if (mask_all) {
+ sigfillset(&act.sa_mask);
+ } else {
+ sigemptyset(&act.sa_mask);
+ }
act.sa_flags = 0;
if (signo == SIGALRM || (! restart)) {
#ifdef SA_INTERRUPT
@@ -43,6 +47,11 @@ Sigfunc *php_signal(int signo, Sigfunc *func, int restart)
return oact.sa_handler;
}
+Sigfunc *php_signal(int signo, Sigfunc *func, int restart)
+{
+ return php_signal4(signo, func, restart, 0);
+}
+
/*
* Local variables:
* tab-width: 4