Merge pull request #14907 from iota97/multi-instance-fix

Add permission to shm_open
This commit is contained in:
Henrik Rydgård 2021-09-21 17:24:17 +02:00 committed by GitHub
commit 4f5d608c80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,7 +145,7 @@ void InitInstanceCounter() {
// TODO : replace shm_open & shm_unlink with ashmem or android-shmem
#else
// Create shared memory object
hIDMapFile = shm_open(ID_SHM_NAME, O_CREAT | O_RDWR, 0);
hIDMapFile = shm_open(ID_SHM_NAME, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
BUF_SIZE = (BUF_SIZE < sysconf(_SC_PAGE_SIZE)) ? sysconf(_SC_PAGE_SIZE) : BUF_SIZE;
if (hIDMapFile < 0 || (ftruncate(hIDMapFile, BUF_SIZE)) == -1) { // Set the size