]> granicus.if.org Git - php/commitdiff
Make timeouts work again for shutdown functions.
authorRasmus Lerdorf <rasmus@php.net>
Wed, 7 Sep 2011 18:48:17 +0000 (18:48 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Wed, 7 Sep 2011 18:48:17 +0000 (18:48 +0000)
Fixes the faling lang/045 test

Zend/zend_execute_API.c

index 839621ea6b79d4ac59e00eb5e7f1ed0679881ad6..2572f85b907c168ba4f7167662db044ae75fb5ad 100644 (file)
@@ -1328,6 +1328,13 @@ ZEND_API void zend_timeout(int dummy) /* {{{ */
        TSRMLS_FETCH();
 
        if (zend_on_timeout) {
+               /* 
+                  We got here because we got a timeout signal, so we are in a signal handler
+                  at this point. However, we want to be able to timeout any user-supplied
+                  shutdown functions, so pretend we are not in a signal handler while we are
+                  calling these 
+               */
+               SIGG(running) = 0;
                zend_on_timeout(EG(timeout_seconds) TSRMLS_CC);
        }