diff options
Diffstat (limited to 'Zend/zend_stream.c')
-rw-r--r-- | Zend/zend_stream.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c index 6d306b337e..b144432db9 100644 --- a/Zend/zend_stream.c +++ b/Zend/zend_stream.c @@ -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; @@ -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_int_t offset = ftell(file_handle->handle.fp); file_handle->handle.stream.mmap.map = *buf; if (offset != -1) { |