diff options
author | Stanley Sufficool <ssufficool@php.net> | 2014-10-20 21:33:32 -0700 |
---|---|---|
committer | Stanley Sufficool <ssufficool@php.net> | 2014-10-20 21:33:32 -0700 |
commit | 8defcb855ab01d9c8ab4759cb793d80149b55a8c (patch) | |
tree | ed51eb30a2cbc92b102557498fb3e4113da1bb07 /Zend/zend_stream.c | |
parent | 9c7dbb0487f5991fde03873ea8f5e66d6688415f (diff) | |
parent | baddb1c73a170ef1d2c31bd54cddbc6e1ab596b9 (diff) | |
download | php-git-8defcb855ab01d9c8ab4759cb793d80149b55a8c.tar.gz |
Merge branch 'master' of https://git.php.net/push/php-src
* 'master' of https://git.php.net/push/php-src: (6215 commits)
Extra comma
Moved proxy object support in ASSIGN_ADD (and family) from VM to slow paths of corresponding operators
Simplification
zend_get_property_info_quick() cleanup and optimization
initialize lineno before calling compile file file in phar
Use ADDREF instead of DUP, it must be enough.
Removed old irrelevant comment
fixed compilation error
Fix bug #68262: Broken reference across cloned objects
export functions needed for phpdbg
Fixed compilation
Optimized property access handlers. Removed EG(std_property_info).
Fixed bug #68199 (PDO::pgsqlGetNotify doesn't support NOTIFY payloads)
Don't make difference between undefined and unaccessible properies when call __get() and family
Don't make useless CSE
array_pop/array_shift optimization
check for zlib headers as well as lib for mysqlnd
a realpath cache key can be int or float, catching this
News entry for new curl constants
News entry for new curl constants
...
Diffstat (limited to 'Zend/zend_stream.c')
-rw-r--r-- | Zend/zend_stream.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c index 835fdbbd7e..f67f59af4a 100644 --- a/Zend/zend_stream.c +++ b/Zend/zend_stream.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -24,9 +24,8 @@ #include "zend.h" #include "zend_compile.h" +#include "zend_stream.h" -#include <sys/types.h> -#include <sys/stat.h> #if HAVE_MMAP # if HAVE_UNISTD_H # include <unistd.h> @@ -64,8 +63,8 @@ static void zend_stream_stdio_closer(void *handle TSRMLS_DC) /* {{{ */ static size_t zend_stream_stdio_fsizer(void *handle TSRMLS_DC) /* {{{ */ { - struct stat buf; - if (handle && fstat(fileno((FILE*)handle), &buf) == 0) { + zend_stat_t buf; + if (handle && zend_fstat(fileno((FILE*)handle), &buf) == 0) { #ifdef S_ISREG if (!S_ISREG(buf.st_mode)) { return 0; @@ -106,7 +105,7 @@ static inline int zend_stream_is_mmap(zend_file_handle *file_handle) { /* {{{ */ static size_t zend_stream_fsize(zend_file_handle *file_handle TSRMLS_DC) /* {{{ */ { - struct stat buf; + zend_stat_t buf; if (zend_stream_is_mmap(file_handle)) { return file_handle->handle.stream.mmap.len; @@ -114,7 +113,7 @@ static size_t zend_stream_fsize(zend_file_handle *file_handle TSRMLS_DC) /* {{{ if (file_handle->type == ZEND_HANDLE_STREAM || file_handle->type == ZEND_HANDLE_MAPPED) { return file_handle->handle.stream.fsizer(file_handle->handle.stream.handle TSRMLS_CC); } - if (file_handle->handle.fp && fstat(fileno(file_handle->handle.fp), &buf) == 0) { + if (file_handle->handle.fp && zend_fstat(fileno(file_handle->handle.fp), &buf) == 0) { #ifdef S_ISREG if (!S_ISREG(buf.st_mode)) { return 0; @@ -237,7 +236,7 @@ ZEND_API int zend_stream_fixup(zend_file_handle *file_handle, char **buf, size_t /* *buf[size] is zeroed automatically by the kernel */ *buf = mmap(0, size + ZEND_MMAP_AHEAD, PROT_READ, MAP_PRIVATE, fileno(file_handle->handle.fp), 0); if (*buf != MAP_FAILED) { - long offset = ftell(file_handle->handle.fp); + zend_long offset = ftell(file_handle->handle.fp); file_handle->handle.stream.mmap.map = *buf; if (offset != -1) { |