From: Dmitry Stogov Date: Tue, 12 Jul 2005 07:18:57 +0000 (+0000) Subject: Fixed bug #33156 (cygwin version of setitimer doesn't accept ITIMER_PROF). (Nuno) X-Git-Tag: php-5.0.5RC1~64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2556bb635cd3e775ee519930f6890e0dd4361259;p=php Fixed bug #33156 (cygwin version of setitimer doesn't accept ITIMER_PROF). (Nuno) --- diff --git a/NEWS b/NEWS index 79bb30d495..328451ee12 100644 --- a/NEWS +++ b/NEWS @@ -39,6 +39,8 @@ PHP NEWS - Fixed bug #33171 (foreach enumerates private fields declared in base classes). (Dmitry) - Fixed bug #33164 (Soap extension incorrectly detects HTTP/1.1). (Ilia) +- Fixed bug #33156 (cygwin version of setitimer doesn't accept ITIMER_PROF). + (Nuno) - Fixed bug #33116 (crash when assigning class name to global variable in __autoload). (Dmitry) - Fixed bug #33090 (mysqli_prepare() doesn't return an error). (Georg) diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 0863845619..a2324126c7 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1280,10 +1280,17 @@ void zend_set_timeout(long seconds) t_r.it_value.tv_sec = seconds; t_r.it_value.tv_usec = t_r.it_interval.tv_sec = t_r.it_interval.tv_usec = 0; +# ifdef __CYGWIN__ + setitimer(ITIMER_REAL, &t_r, NULL); + signal(SIGALRM, zend_timeout); + sigemptyset(&sigset); + sigaddset(&sigset, SIGALRM); +# else setitimer(ITIMER_PROF, &t_r, NULL); signal(SIGPROF, zend_timeout); sigemptyset(&sigset); sigaddset(&sigset, SIGPROF); +# endif sigprocmask(SIG_UNBLOCK, &sigset, NULL); } # endif