summaryrefslogtreecommitdiff
path: root/Zend/zend_stream.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2009-01-09 17:21:12 +0000
committerIlia Alshanetsky <iliaa@php.net>2009-01-09 17:21:12 +0000
commit71ea95354b4133f12dcf8207bc7b36e1562bdd65 (patch)
treed086c5d9579dfef4baeaceb7519080dbdf086ab1 /Zend/zend_stream.c
parent2538bd21e7086941dea30e59ac3927654ea2d9db (diff)
downloadphp-git-71ea95354b4133f12dcf8207bc7b36e1562bdd65.tar.gz
MFH: Corrected fix for bug #46844 to only trigger on the 1st line of CLI
opened files.
Diffstat (limited to 'Zend/zend_stream.c')
-rw-r--r--Zend/zend_stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c
index 6e5f3f3836..10183d664b 100644
--- a/Zend/zend_stream.c
+++ b/Zend/zend_stream.c
@@ -214,7 +214,7 @@ ZEND_API int zend_stream_fixup(zend_file_handle *file_handle, char **buf, size_t
#if HAVE_MMAP
if (file_handle->handle.fp) {
/* *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);
+ *buf = mmap(0, size + ZEND_MMAP_AHEAD, PROT_READ, MAP_PRIVATE, fileno(file_handle->handle.fp), ftell(file_handle->handle.fp));
if (*buf != MAP_FAILED) {
file_handle->handle.stream.mmap.len = size;
file_handle->handle.stream.mmap.map = *buf;