[totem-pl-parser] Fix mmap error checking
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem-pl-parser] Fix mmap error checking
- Date: Sun, 31 Jan 2016 08:59:34 +0000 (UTC)
commit 7e4f4a64336a41da86c322894d4c5d2ea697a089
Author: Michael McConville <mmcco mykolab com>
Date: Sat Jan 30 17:41:35 2016 -0500
Fix mmap error checking
mmap returns MAP_FAILED, not NULL, on failure.
plparse/xmlparser.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/plparse/xmlparser.c b/plparse/xmlparser.c
index ee55c39..2a84b64 100644
--- a/plparse/xmlparser.c
+++ b/plparse/xmlparser.c
@@ -924,7 +924,7 @@ int main (int argc, char **argv)
continue;
}
buf = mmap (NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
- if (!buf)
+ if (buf == MAP_FAILED)
{
perror (argv[i]);
if (close (fd))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]