svn commit: r345474 - head/lib/libvgl
Bruce Evans
bde at FreeBSD.org
Sun Mar 24 16:47:44 UTC 2019
Author: bde
Date: Sun Mar 24 16:47:43 2019
New Revision: 345474
URL: https://svnweb.freebsd.org/changeset/base/345474
Log:
Fix libvgl to not always fail to initialize due to its invalid mmap()
args (neither MAP_PRIVATE nor MAP_SHARED). It was broken in r271635
and/or r271724 by stricter checking. The compatibility code in r271724
doesn't work for my old binaries (actually new binaries with old
libraries).
PR: needed to test the fix for PR 162373
Modified:
head/lib/libvgl/main.c
Modified: head/lib/libvgl/main.c
==============================================================================
--- head/lib/libvgl/main.c Sun Mar 24 15:08:30 2019 (r345473)
+++ head/lib/libvgl/main.c Sun Mar 24 16:47:43 2019 (r345474)
@@ -301,7 +301,7 @@ VGLInit(int mode)
VGLDisplay->Yorigin = 0;
VGLMem = (byte*)mmap(0, VGLAdpInfo.va_window_size, PROT_READ|PROT_WRITE,
- MAP_FILE, 0, 0);
+ MAP_FILE | MAP_SHARED, 0, 0);
if (VGLMem == MAP_FAILED) {
VGLEnd();
return -7;
@@ -350,7 +350,7 @@ VGLCheckSwitch()
ioctl(0, VGLMode, 0);
VGLCurWindow = 0;
VGLMem = (byte*)mmap(0, VGLAdpInfo.va_window_size, PROT_READ|PROT_WRITE,
- MAP_FILE, 0, 0);
+ MAP_FILE | MAP_SHARED, 0, 0);
/* XXX: what if mmap() has failed! */
VGLDisplay->Type = VIDBUF8; /* XXX */
More information about the svn-src-all
mailing list