summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-02-14 17:10:35 -0800
committerKhem Raj <raj.khem@gmail.com>2020-02-15 08:05:07 -0800
commit25e8539bfd754455513be12350967aa989c391c7 (patch)
treef2ed8eae2f4558522d2c31a4d2c234bfd29ef116 /meta-oe
parent16fd296360f803a6a1644954ed53b632583eb3ca (diff)
downloadmeta-openembedded-25e8539bfd754455513be12350967aa989c391c7.tar.gz
libmimetic: Fix ordrered comparision between pointer and zero
Found with clang Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: asmitha <asmithakarun@gmail.com>
Diffstat (limited to 'meta-oe')
-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"