summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-support/libmimetic/libmimetic/0001-mimetic-Check-for-MMAP_FAILED-return-from-mmap.patch49
-rw-r--r--meta-oe/recipes-support/libmimetic/libmimetic_0.9.8.bb1
2 files changed, 50 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/libmimetic/libmimetic/0001-mimetic-Check-for-MMAP_FAILED-return-from-mmap.patch b/meta-oe/recipes-support/libmimetic/libmimetic/0001-mimetic-Check-for-MMAP_FAILED-return-from-mmap.patch
new file mode 100644
index 0000000000..c7c8d62aaa
--- /dev/null
+++ b/meta-oe/recipes-support/libmimetic/libmimetic/0001-mimetic-Check-for-MMAP_FAILED-return-from-mmap.patch
@@ -0,0 +1,49 @@
1From f8ab2b1aaa37f6ba9d527a99cb37b6ac2171e122 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 14 Feb 2020 17:03:12 -0800
4Subject: [PATCH] mimetic: Check for MMAP_FAILED return from mmap()
5
6Avoids using greater than zero comparision on pointers
7
8Fixes
9mimetic/os/mmfile.cxx:60:14: error: ordered comparison between pointer and zero ('char *' and 'int')
10
11if(m_beg > 0)
12~~~~ ^ ~
13
14Upstream-Status: Pending
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17 mimetic/os/mmfile.cxx | 16 +++++++---------
18 1 file changed, 7 insertions(+), 9 deletions(-)
19
20diff --git a/mimetic/os/mmfile.cxx b/mimetic/os/mmfile.cxx
21index dfc95b7..ed4ff55 100644
22--- a/mimetic/os/mmfile.cxx
23+++ b/mimetic/os/mmfile.cxx
24@@ -57,15 +57,13 @@ bool MMFile::open(int mode)
25 bool MMFile::map()
26 {
27 m_beg = (char*) mmap(0, m_st.st_size, PROT_READ, MAP_SHARED,m_fd,0);
28- if(m_beg > 0)
29- {
30- m_end = m_beg + m_st.st_size;
31- #if HAVE_MADVISE
32- madvise(m_beg, m_st.st_size, MADV_SEQUENTIAL);
33- #endif
34- return true;
35- }
36- return false;
37+ if(m_beg == MAP_FAILED)
38+ return false;
39+ m_end = m_beg + m_st.st_size;
40+ #if HAVE_MADVISE
41+ madvise(m_beg, m_st.st_size, MADV_SEQUENTIAL);
42+ #endif
43+ return true;
44 }
45
46 MMFile::~MMFile()
47--
482.25.0
49
diff --git a/meta-oe/recipes-support/libmimetic/libmimetic_0.9.8.bb b/meta-oe/recipes-support/libmimetic/libmimetic_0.9.8.bb
index fd65db2d39..d0fe498adc 100644
--- a/meta-oe/recipes-support/libmimetic/libmimetic_0.9.8.bb
+++ b/meta-oe/recipes-support/libmimetic/libmimetic_0.9.8.bb
@@ -12,6 +12,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=b49da7df0ca479ef01ff7f2d799eabee"
12SRCREV = "50486af99b4f9b35522d7b3de40b6ce107505279" 12SRCREV = "50486af99b4f9b35522d7b3de40b6ce107505279"
13SRC_URI += "git://github.com/LadislavSopko/mimetic/ \ 13SRC_URI += "git://github.com/LadislavSopko/mimetic/ \
14 file://0001-libmimetic-Removing-test-directory-from-the-Makefile.patch \ 14 file://0001-libmimetic-Removing-test-directory-from-the-Makefile.patch \
15 file://0001-mimetic-Check-for-MMAP_FAILED-return-from-mmap.patch \
15 " 16 "
16 17
17S = "${WORKDIR}/git" 18S = "${WORKDIR}/git"