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
This commit is contained in:
bde 2019-03-24 16:47:43 +00:00
parent 7dbe184dfc
commit 068eaf9a72

View File

@ -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 */