blob: d6c6582cd42f2584c2ad814b640c42922edfc47d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
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
|