summaryrefslogtreecommitdiff
path: root/sapi/cgi/cgi_main.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-07-16 16:21:45 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-07-16 16:44:37 +0200
commit46faf8f018e95de27873dbcf7c094af18c4c08e4 (patch)
treeedd85291c8c8070f3182617152098c9289242e6e /sapi/cgi/cgi_main.c
parent349a388b90e767da9128efe6da0e4ebf5c752092 (diff)
downloadphp-git-46faf8f018e95de27873dbcf7c094af18c4c08e4.tar.gz
Introduce zend_stream_init_fp() API
Reduce the amount of code that mucks around with zend_file_handle initialization.
Diffstat (limited to 'sapi/cgi/cgi_main.c')
-rw-r--r--sapi/cgi/cgi_main.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 46eb822525..1068930c39 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -2479,15 +2479,12 @@ parent_loop_end:
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = SG(request_info).path_translated;
file_handle.handle.fp = NULL;
+ file_handle.opened_path = NULL;
+ file_handle.free_filename = 0;
} else {
- file_handle.filename = "Standard input code";
- file_handle.type = ZEND_HANDLE_FP;
- file_handle.handle.fp = stdin;
+ zend_stream_init_fp(&file_handle, stdin, "Standard input code");
}
- file_handle.opened_path = NULL;
- file_handle.free_filename = 0;
-
/* request startup only after we've done all we can to
* get path_translated */
if (php_request_startup() == FAILURE) {