]> granicus.if.org Git - php/commitdiff
MFH: Preserve exit status for non-php execution modes.
authorIlia Alshanetsky <iliaa@php.net>
Fri, 1 Aug 2003 16:53:03 +0000 (16:53 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 1 Aug 2003 16:53:03 +0000 (16:53 +0000)
sapi/cgi/cgi_main.c
sapi/cli/php_cli.c

index 575b1be6a14993cf2593dfa74754422b33423677..281951ec42f7a86ed8371dc357e71951bbf3edf5 100644 (file)
@@ -1540,7 +1540,6 @@ consult the installation file that came with this distribution, or visit \n\
                switch (behavior) {
                        case PHP_MODE_STANDARD:
                                php_execute_script(&file_handle TSRMLS_CC);
-                               exit_status = EG(exit_status);
                                break;
                        case PHP_MODE_LINT:
                                PG(during_request_startup) = 0;
@@ -1597,7 +1596,9 @@ fastcgi_request_done:
                        }
                        
                        php_request_shutdown((void *) 0);
-                       exit_status = EG(exit_status);
+                       if (exit_status == 0) {
+                               exit_status = EG(exit_status);
+                       }
 
                        if (SG(request_info).path_translated) {
                                free(SG(request_info).path_translated);
index 3b0e1a931c9ab05d980a5eb637e275fad3b81f0c..42b935f834fac54b690457c0cb621a47f89d4aa1 100644 (file)
@@ -869,7 +869,9 @@ int main(int argc, char *argv[])
 
 out:
        php_request_shutdown((void *) 0);
-       exit_status = EG(exit_status);
+       if (exit_status == 0) {
+               exit_status = EG(exit_status);
+       }
 out_err:       
        if (module_started) {
                php_module_shutdown(TSRMLS_C);