fixes in shared memory:
only allow server to create and initialize shared memory, client will report failure intercept signals to cleanup shared memory in standalone app, thanks to Roland Philippsen.
This commit is contained in:
@@ -40,10 +40,10 @@ struct btPointerCaster
|
||||
};
|
||||
};
|
||||
|
||||
void* PosixSharedMemory::allocateSharedMemory(int key, int size, bool /*allowCreation*/)
|
||||
void* PosixSharedMemory::allocateSharedMemory(int key, int size, bool allowCreation)
|
||||
{
|
||||
#ifdef TEST_SHARED_MEMORY
|
||||
int flags = IPC_CREAT | 0666;
|
||||
int flags = (allowCreation ? IPC_CREAT : 0) | 0666;
|
||||
int id = shmget((key_t) key, (size_t) size,flags);
|
||||
if (id < 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user