From e945608fa46a41e0d0c4368ff3792bb5bd202e6a Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Fri, 1 Aug 2003 12:29:48 +0000 Subject: [PATCH] MFH: Fixed bug #23509 (exit code lost when exit() called from register_shutdown_function()) --- NEWS | 2 ++ sapi/cgi/cgi_main.c | 1 + sapi/cli/php_cli.c | 4 +--- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 912bdbe952..b1b00e7941 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP 4 NEWS ?? Aug 2003, Version 4.3.3RC3 - Fixed bug #24883 (variables_order and gpc_order being ignored). (Ilia) - Fixed bug #24871 (methods misidentified as constructors). (Ilia) +- Fixed bug #23509 (exit code lost when exit() called from + register_shutdown_function()). (Ilia) - Fixed bug #22154 (Possible crash when memory_limit is reached and output buffering in addition to session.use_trans_sid is used). (Ilia) diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 4d6cf16568..575b1be6a1 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -1597,6 +1597,7 @@ fastcgi_request_done: } php_request_shutdown((void *) 0); + exit_status = EG(exit_status); if (SG(request_info).path_translated) { free(SG(request_info).path_translated); diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 11365dff78..3b0e1a931c 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -865,13 +865,11 @@ int main(int argc, char *argv[]) if (cli_sapi_module.php_ini_path_override) { free(cli_sapi_module.php_ini_path_override); } - - } zend_catch { - exit_status = EG(exit_status); } zend_end_try(); out: php_request_shutdown((void *) 0); + exit_status = EG(exit_status); out_err: if (module_started) { php_module_shutdown(TSRMLS_C); -- 2.50.1