]> granicus.if.org Git - php/commitdiff
- MFH: Fix #34557 php -m exits with "error" 1
authorJohannes Schlüter <johannes@php.net>
Thu, 6 Oct 2005 20:29:41 +0000 (20:29 +0000)
committerJohannes Schlüter <johannes@php.net>
Thu, 6 Oct 2005 20:29:41 +0000 (20:29 +0000)
sapi/cgi/cgi_main.c
sapi/cli/php_cli.c

index d6ad516a50e047de8d367fb8c143676ddd928993..7597bff7a6d26c1bc31c2460c0e9e785fff82d5a 100644 (file)
@@ -1366,7 +1366,7 @@ consult the installation file that came with this distribution, or visit \n\
                                                }
                                                php_print_info(0xFFFFFFFF TSRMLS_CC);
                                                php_end_ob_buffers(1 TSRMLS_CC);
-                                               exit(1);
+                                               exit(0);
                                                break;
 
                                case 'l': /* syntax check mode */
@@ -1384,7 +1384,7 @@ consult the installation file that came with this distribution, or visit \n\
                                        print_extensions(TSRMLS_C);
                                        php_printf("\n");
                                        php_end_ob_buffers(1 TSRMLS_CC);
-                                       exit(1);
+                                       exit(0);
                                        break;
 
 #if 0 /* not yet operational, see also below ... */
@@ -1417,7 +1417,7 @@ consult the installation file that came with this distribution, or visit \n\
                                                php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2005 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
 #endif
                                                php_end_ob_buffers(1 TSRMLS_CC);
-                                               exit(1);
+                                               exit(0);
                                                break;
 
                                case 'w':
index 1767b9c9403d6969011d831608c1fa73c920cc8a..6cefbf303cf52bad5472ce97c1a67c8e118c254b 100644 (file)
@@ -697,8 +697,9 @@ int main(int argc, char *argv[])
                                php_output_activate(TSRMLS_C);
                                php_cli_usage(argv[0]);
                                php_end_ob_buffers(1 TSRMLS_CC);
-                               exit_status=1;
-                               goto err;
+                               exit_status=0;
+                               zend_ini_deactivate(TSRMLS_C);
+                               goto out_err;
 
 
                        case 'i': /* php info & quit */
@@ -707,7 +708,7 @@ int main(int argc, char *argv[])
                                }
                                php_print_info(0xFFFFFFFF TSRMLS_CC);
                                php_end_ob_buffers(1 TSRMLS_CC);
-                               exit_status=1;
+                               exit_status=0;
                                goto out;
 
                        case 'm': /* list compiled in modules */
@@ -719,8 +720,9 @@ int main(int argc, char *argv[])
                                print_extensions(TSRMLS_C);
                                php_printf("\n");
                                php_end_ob_buffers(1 TSRMLS_CC);
-                               exit_status=1;
-                               goto err;
+                               exit_status=0;
+                               zend_ini_deactivate(TSRMLS_C);
+                               goto out_err;
 
                        case 'v': /* show php version & quit */
                                if (php_request_startup(TSRMLS_C)==FAILURE) {
@@ -732,7 +734,7 @@ int main(int argc, char *argv[])
                                php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2005 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
 #endif
                                php_end_ob_buffers(1 TSRMLS_CC);
-                               exit_status=1;
+                               exit_status=0;
                                goto out;
 
                        default: