From: Dmitry Stogov Date: Tue, 12 Jul 2005 06:52:59 +0000 (+0000) Subject: Fixed bug #33156 (cygwin version of setitimer doesn't accept ITIMER_PROF). (Nuno) X-Git-Tag: php-5.1.0b3~34 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c25b8a36998bde3be00ef4a893febf474969aaf9;p=php Fixed bug #33156 (cygwin version of setitimer doesn't accept ITIMER_PROF). (Nuno) --- diff --git a/NEWS b/NEWS index b2b968f61f..4dc581bc81 100644 --- a/NEWS +++ b/NEWS @@ -40,6 +40,8 @@ PHP NEWS - Fixed bug #31358 (Older GCC versions do not provide portable va_copy()). (Jani) - Fixed bug #31158 (array_splice on $GLOBALS crashes). (Dmitry) +- Fixed bug #33156 (cygwin version of setitimer doesn't accept ITIMER_PROF). + (Nuno) - Fixed bug #30828 (debug_backtrace() reports incorrect class in overridden methods). (Dmitry) - Fixed bug #30519 (Interface not existing says Class not found). (Dmitry) diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index adda863112..a5fbb46995 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1284,10 +1284,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