com php-src: Fixed bug #62725 (Calling exit() in a shutdown function does not return the exit value): NEWS sapi/cli/php_cli.c
| From: | Xinchen Hui | Date: | Thu, 02 Aug 2012 15:03:38 +0000 |
| Subject: | com php-src: Fixed bug #62725 (Calling exit() in a shutdown function does not return the exit value): NEWS sapi/cli/php_cli.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-69762@lists.php.net to get a copy of this message | ||
Commit: d1f0662e4d587754742891f0a179551d8f36674f
Author: Xinchen Hui <laruence@php.net> Thu, 2 Aug 2012 23:03:38 +0800
Parents: 170ee90bf962d288bdcf6cf0c8c4a2a30c5c1ba2
Branches: PHP-5.4
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d1f0662e4d587754742891f0a179551d8f36674f
Log:
Fixed bug #62725 (Calling exit() in a shutdown function does not return the exit value)
The fix is make 5.4 behavior consistent with 5.3
Bugs:
https://bugs.php.net/62725
Changed paths:
M NEWS
M sapi/cli/php_cli.c
Diff:
diff --git a/NEWS b/NEWS
index 6b0d2d9..623a791 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2012, PHP 5.4.7
+- Core:
+ . Fixed bug #62725 (Calling exit() in a shutdown function does not return
+ the exit value). (Laruence)
+
- PDO:
. Fixed bug #62685 (Wrong return datatype in PDO::inTransaction()). (Laruence)
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index 2cdd1aa..f9bf3ee 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -1167,15 +1167,15 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
} zend_end_try();
out:
- if (exit_status == 0) {
- exit_status = EG(exit_status);
- }
if (request_started) {
php_request_shutdown((void *) 0);
}
if (translated_path) {
free(translated_path);
}
+ if (exit_status == 0) {
+ exit_status = EG(exit_status);
+ }
return exit_status;
err:
sapi_deactivate(TSRMLS_C);