summaryrefslogtreecommitdiff
path: root/main/main.c
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2002-03-19 23:29:37 +0000
committerWez Furlong <wez@php.net>2002-03-19 23:29:37 +0000
commit7990d742e5fc32d5b1c9c49b7aab2e41acd75d0f (patch)
tree9917162cc0af4701ce0dd7ffc8cdb2dc26181f89 /main/main.c
parent2adf5bea7c00fcf5184a5377ad075dde494305fd (diff)
downloadphp-git-7990d742e5fc32d5b1c9c49b7aab2e41acd75d0f.tar.gz
Improve behaviour of the stream casting operation.
Improve interaction with fopencookie.
Diffstat (limited to 'main/main.c')
-rw-r--r--main/main.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/main/main.c b/main/main.c
index e6b8c8f0fd..1601b2b493 100644
--- a/main/main.c
+++ b/main/main.c
@@ -564,26 +564,14 @@ PHP_FUNCTION(set_time_limit)
static FILE *php_fopen_wrapper_for_zend(const char *filename, char **opened_path)
{
FILE *retval = NULL;
- php_stream *stream;
size_t old_chunk_size;
TSRMLS_FETCH();
old_chunk_size = FG(def_chunk_size);
FG(def_chunk_size) = 1;
- stream = php_stream_open_wrapper((char *)filename, "rb", USE_PATH|IGNORE_URL_WIN|REPORT_ERRORS, opened_path);
+ retval = php_stream_open_wrapper_as_file((char *)filename, "rb", USE_PATH|IGNORE_URL_WIN|REPORT_ERRORS, opened_path);
FG(def_chunk_size) = old_chunk_size;
- if (stream) {
- /* when this succeeds, stream either has or will be freed automatically */
- if (php_stream_cast(stream, PHP_STREAM_AS_STDIO|PHP_STREAM_CAST_TRY_HARD|PHP_STREAM_CAST_RELEASE,
- (void**)&retval, REPORT_ERRORS) == FAILURE)
- {
- php_stream_close(stream);
- if (opened_path && *opened_path)
- efree(*opened_path);
- retval = NULL;
- }
- }
return retval;
}
/* }}} */