devel/ptlib: properly detect mmap(2) failure

PR:		216019
MFH:		2017Q1
This commit is contained in:
Jan Beich 2017-01-21 04:40:06 +00:00
parent 3c0323a949
commit 265543def8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=432013
3 changed files with 23 additions and 0 deletions

View file

@ -3,6 +3,7 @@
PORTNAME= ptlib
PORTVERSION= 2.10.11
PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= GNOME

View file

@ -0,0 +1,11 @@
--- plugins/vidinput_bsd/vidinput_bsd.cxx.orig 2013-08-14 23:20:28 UTC
+++ plugins/vidinput_bsd/vidinput_bsd.cxx
@@ -308,7 +308,7 @@ PBoolean PVideoInputDevice_BSDCAPTURE::G
mmap_size = frameBytes;
videoBuffer = (BYTE *)::mmap(0, mmap_size, PROT_READ, 0, videoFd, 0);
- if (videoBuffer < 0) {
+ if (videoBuffer == MAP_FAILED) {
return PFalse;
} else {
canMap = 1;

View file

@ -0,0 +1,11 @@
--- plugins/vidinput_v4l/vidinput_v4l.cxx.orig 2013-08-14 23:20:28 UTC
+++ plugins/vidinput_v4l/vidinput_v4l.cxx
@@ -978,7 +978,7 @@ PBoolean PVideoInputDevice_V4L::GetFrame
} else {
videoBuffer = (BYTE *)::mmap(0, frame.size, PROT_READ|PROT_WRITE, MAP_SHARED, videoFd, 0);
- if (videoBuffer < 0) {
+ if (videoBuffer == MAP_FAILED) {
canMap = 0;
PTRACE(3, "VideoGrabber " << deviceName << " cannot do memory mapping - ::mmap failed.");
//This video device cannot do memory mapping.