summaryrefslogtreecommitdiff
path: root/main/main.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2012-01-17 09:30:12 +0000
committerDmitry Stogov <dmitry@php.net>2012-01-17 09:30:12 +0000
commitccd1b15bd06a388436be2193773489fd10bef26b (patch)
tree012f9947b002c6695734638ede2aa71fb9b1a90a /main/main.c
parent93ee94adb609f34699e5535465589bea05c51b8a (diff)
downloadphp-git-ccd1b15bd06a388436be2193773489fd10bef26b.tar.gz
Fixed workaround for bug #48034 on Windows (Crash when script is 8192 (8KB) bytes long)
Diffstat (limited to 'main/main.c')
-rw-r--r--main/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/main.c b/main/main.c
index b81c71ef23..6506e10af6 100644
--- a/main/main.c
+++ b/main/main.c
@@ -92,7 +92,7 @@
#include "SAPI.h"
#include "rfc1867.h"
-#if HAVE_MMAP
+#if HAVE_MMAP || defined(PHP_WIN32)
# if HAVE_UNISTD_H
# include <unistd.h>
# if defined(_SC_PAGESIZE)
@@ -1216,7 +1216,7 @@ PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle *h
php_stream *stream = php_stream_open_wrapper((char *)filename, "rb", mode, &handle->opened_path);
if (stream) {
-#if HAVE_MMAP
+#if HAVE_MMAP || defined(PHP_WIN32)
size_t page_size = REAL_PAGE_SIZE;
#endif
@@ -1230,7 +1230,7 @@ PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle *h
memset(&handle->handle.stream.mmap, 0, sizeof(handle->handle.stream.mmap));
len = php_zend_stream_fsizer(stream TSRMLS_CC);
if (len != 0
-#if HAVE_MMAP
+#if HAVE_MMAP || defined(PHP_WIN32)
&& ((len - 1) % page_size) <= page_size - ZEND_MMAP_AHEAD
#endif
&& php_stream_mmap_possible(stream)