]> granicus.if.org Git - php/commitdiff
Return the exit status from php_execute_script()
authorSascha Schumann <sas@php.net>
Wed, 22 Nov 2000 04:23:26 +0000 (04:23 +0000)
committerSascha Schumann <sas@php.net>
Wed, 22 Nov 2000 04:23:26 +0000 (04:23 +0000)
main/main.c
main/php_main.h

index 4375e91fda40163117f51421befc85d35aec2e33..e9ec85919882ae38c8c169c4956f25e74f6a9744 100644 (file)
@@ -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)
index 09ec56d0cbd3302e1f115a58e07e9bbe44ffcedb..1ec9c5c14bf7228e966f630d765f1f74e7331f0d 100644 (file)
@@ -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);