You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-libs/mimetic/files/mimetic-0.9.8-build-mmap.patch

23 lines
688 B

From bf84940f9021950c80846e6b1a5f8b0b55991b00 Mon Sep 17 00:00:00 2001
From: Stefano Barbato <stefano@parkopedia.com>
Date: Sat, 27 Apr 2019 15:00:58 +0200
Subject: [PATCH] better mmap error check
---
mimetic/os/mmfile.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mimetic/os/mmfile.cxx b/mimetic/os/mmfile.cxx
index dfc95b7..9627516 100644
--- a/mimetic/os/mmfile.cxx
+++ b/mimetic/os/mmfile.cxx
@@ -57,7 +57,7 @@ bool MMFile::open(int mode)
bool MMFile::map()
{
m_beg = (char*) mmap(0, m_st.st_size, PROT_READ, MAP_SHARED,m_fd,0);
- if(m_beg > 0)
+ if(m_beg != MAP_FAILED)
{
m_end = m_beg + m_st.st_size;
#if HAVE_MADVISE