diff options
Diffstat (limited to 'sapi/cli/php_cli_server.c')
-rw-r--r-- | sapi/cli/php_cli_server.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index f00d8dee54..d83451f5f3 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | @@ -384,7 +382,7 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */ zval tmp; if (zend_parse_parameters_none() == FAILURE) { - return; + RETURN_THROWS(); } client = SG(server_context); @@ -430,7 +428,7 @@ static void add_response_header(sapi_header_struct *h, zval *return_value) /* {{ PHP_FUNCTION(apache_response_headers) /* {{{ */ { if (zend_parse_parameters_none() == FAILURE) { - return; + RETURN_THROWS(); } array_init(return_value); @@ -510,7 +508,7 @@ static int sapi_cli_server_startup(sapi_module_struct *sapi_module) /* {{{ */ if (php_cli_server_workers_max > 1) { zend_long php_cli_server_worker; - + php_cli_server_workers = calloc( php_cli_server_workers_max, sizeof(pid_t)); if (!php_cli_server_workers) { @@ -528,7 +526,7 @@ static int sapi_cli_server_startup(sapi_module_struct *sapi_module) /* {{{ */ if (pid == FAILURE) { /* no more forks allowed, work with what we have ... */ - php_cli_server_workers_max = + php_cli_server_workers_max = php_cli_server_worker + 1; return SUCCESS; } else if (pid == SUCCESS) { @@ -2204,8 +2202,6 @@ static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server decline = Z_TYPE(retval) == IS_FALSE; zval_ptr_dtor(&retval); } - } else { - decline = 1; } } zend_end_try(); @@ -2321,14 +2317,14 @@ static void php_cli_server_dtor(php_cli_server *server) /* {{{ */ int php_cli_server_worker_status; do { - if (waitpid(php_cli_server_workers[php_cli_server_worker], - &php_cli_server_worker_status, + if (waitpid(php_cli_server_workers[php_cli_server_worker], + &php_cli_server_worker_status, 0) == FAILURE) { /* an extremely bad thing happened */ break; } - } while (!WIFEXITED(php_cli_server_worker_status) && + } while (!WIFEXITED(php_cli_server_worker_status) && !WIFSIGNALED(php_cli_server_worker_status)); } |