diff options
author | Sascha Schumann <sas@php.net> | 2000-11-22 04:23:26 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 2000-11-22 04:23:26 +0000 |
commit | 0222f92358c6de5426e5111a7987bd80b470f2e6 (patch) | |
tree | 7fb325c4421f7af3ca05fc5efa7346bffc3d4715 | |
parent | 939b72c77127762fa9e975486fc5034b8f6a7a3e (diff) | |
download | php-git-0222f92358c6de5426e5111a7987bd80b470f2e6.tar.gz |
Return the exit status from php_execute_script()
-rw-r--r-- | main/main.c | 9 | ||||
-rw-r--r-- | main/php_main.h | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/main/main.c b/main/main.c index 4375e91fda..e9ec859198 100644 --- a/main/main.c +++ b/main/main.c @@ -1167,15 +1167,16 @@ PHPAPI int php_handle_special_queries(SLS_D PLS_DC) return 0; } -PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_DC) +PHPAPI int php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_DC) { zend_file_handle *prepend_file_p, *append_file_p; zend_file_handle prepend_file, append_file; char *old_cwd; SLS_FETCH(); + EG(exit_status) = 0; if (php_handle_special_queries(SLS_C PLS_CC)) - return; + return 0; #define OLD_CWD_SIZE 4096 old_cwd = do_alloca(OLD_CWD_SIZE); old_cwd[0] = '\0'; @@ -1184,7 +1185,7 @@ PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_ if (old_cwd[0] != '\0') V_CHDIR(old_cwd); free_alloca(old_cwd); - return; + return EG(exit_status); } #ifdef PHP_WIN32 @@ -1222,6 +1223,8 @@ PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_ if (old_cwd[0] != '\0') V_CHDIR(old_cwd); free_alloca(old_cwd); + + return EG(exit_status); } PHPAPI void php_handle_aborted_connection(void) diff --git a/main/php_main.h b/main/php_main.h index 09ec56d0cb..1ec9c5c14b 100644 --- a/main/php_main.h +++ b/main/php_main.h @@ -40,7 +40,7 @@ PHPAPI int php_startup_extensions(zend_module_entry **ptr, int count); PHPAPI int php_global_startup_extensions(zend_module_entry **ptr, int count); PHPAPI int php_global_shutdown_extensions(zend_module_entry **ptr, int count); -PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_DC); +PHPAPI int php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_DC); PHPAPI int php_handle_special_queries(SLS_D PLS_DC); PHPAPI int php_lint_script(zend_file_handle *file CLS_DC ELS_DC PLS_DC); |