summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2018-08-21 23:51:54 +0100
committerNikita Popov <nikita.ppv@gmail.com>2018-08-22 11:19:52 +0200
commit446b5b15d324dacd30f58313563a9d625fb54ac8 (patch)
tree17270a3f4a4df97b0266360cf2cf162cfe1200c0
parent8d95f561e45b5aee5398c772284bdeff03fbb475 (diff)
downloadphp-git-446b5b15d324dacd30f58313563a9d625fb54ac8.tar.gz
Don't report mmap failure if it is expected
When using mmap with MAP_FIXED_NOREPLACE or MAP_FIXED|MAP_EXCL an mmap failure is not an error condition, so do not print an error message in this case.
-rw-r--r--Zend/zend_alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index 8eec54c6f7..d81616a87a 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -432,7 +432,7 @@ static void *zend_mm_mmap_fixed(void *addr, size_t size)
void *ptr = mmap(addr, size, PROT_READ | PROT_WRITE, flags /*| MAP_POPULATE | MAP_HUGETLB*/, -1, 0);
if (ptr == MAP_FAILED) {
-#if ZEND_MM_ERROR
+#if ZEND_MM_ERROR && !defined(MAP_FIXED_NOREPLACE) && !defined(MAP_EXCL)
fprintf(stderr, "\nmmap() failed: [%d] %s\n", errno, strerror(errno));
#endif
return NULL;