diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-17 11:01:57 +0200 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-17 11:22:31 +0200 |
| commit | 5a90dc77b8f244f603082aea022fadc0ce2c009c (patch) | |
| tree | a5682b1836a838aa9592cc831142b13042b752ec /main/main.c | |
| parent | 6fbab09ef042df66153e4feaae8e07091d3d173e (diff) | |
| download | php-git-5a90dc77b8f244f603082aea022fadc0ce2c009c.tar.gz | |
Avoid unused fstat() call
If we're including a file via PHP streams, we're not going to trust
the reported file size anyway and populate in a loop -- so don't
bother determining the file size in the first place. Only do this
for non-tty HANDLE_FP now, which is the only case where this
information was used.
Diffstat (limited to 'main/main.c')
| -rw-r--r-- | main/main.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/main/main.c b/main/main.c index 809ebbfd5e..bd713d3137 100644 --- a/main/main.c +++ b/main/main.c @@ -1562,16 +1562,6 @@ static void php_zend_stream_closer(void *handle) /* {{{ */ } /* }}} */ -static size_t php_zend_stream_fsizer(void *handle) /* {{{ */ -{ - php_stream_statbuf ssb; - if (php_stream_stat((php_stream*)handle, &ssb) == 0) { - return ssb.sb.st_size; - } - return 0; -} -/* }}} */ - static int php_stream_open_for_zend(const char *filename, zend_file_handle *handle) /* {{{ */ { return php_stream_open_for_zend_ex(filename, handle, USE_PATH|REPORT_ERRORS|STREAM_OPEN_FOR_INCLUDE); @@ -1589,7 +1579,6 @@ PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle *h handle->opened_path = opened_path; handle->handle.stream.handle = stream; handle->handle.stream.reader = (zend_stream_reader_t)_php_stream_read; - handle->handle.stream.fsizer = php_zend_stream_fsizer; handle->handle.stream.isatty = 0; handle->handle.stream.closer = php_zend_stream_closer; /* suppress warning if this stream is not explicitly closed */ |
