Skip to content

Commit ae7364b

Browse files
committed
Move zend_max_execution_timer_init() to php_child_init(), and call php_child_init() in pcntl_rfork()/pcntl_forkx()
1 parent c7f7412 commit ae7364b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ext/pcntl/pcntl.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ PHP_FUNCTION(pcntl_fork)
299299
}
300300
} else if (id == 0) {
301301
php_child_init();
302-
zend_max_execution_timer_init();
303302
}
304303

305304
RETURN_LONG((zend_long) id);
@@ -1562,7 +1561,7 @@ PHP_FUNCTION(pcntl_rfork)
15621561
php_error_docref(NULL, E_WARNING, "Error %d", errno);
15631562
}
15641563
} else if (pid == 0) {
1565-
zend_max_execution_timer_init();
1564+
php_child_init();
15661565
}
15671566

15681567
RETURN_LONG((zend_long) pid);
@@ -1607,7 +1606,7 @@ PHP_FUNCTION(pcntl_forkx)
16071606
php_error_docref(NULL, E_WARNING, "Error %d", errno);
16081607
}
16091608
} else if (pid == 0) {
1610-
zend_max_execution_timer_init();
1609+
php_child_init();
16111610
}
16121611

16131612
RETURN_LONG((zend_long) pid);

main/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,6 +1819,7 @@ static void sigchld_handler(int apar)
18191819
PHPAPI void php_child_init(void)
18201820
{
18211821
refresh_memory_manager();
1822+
zend_max_execution_timer_init();
18221823
}
18231824

18241825
/* {{{ php_request_startup */

0 commit comments

Comments
 (0)