mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-20 00:37:12 +02:00
size of shm needs to be only sometimes checked when opening shared memory (#443)
This commit is contained in:
@ -101,14 +101,15 @@ template <typename T> class SharedMemory {
|
||||
LOG(logINFO) << "Shared memory created " << name;
|
||||
}
|
||||
|
||||
void openSharedMemory() {
|
||||
void openSharedMemory(bool verifySize) {
|
||||
int fd = shm_open(name.c_str(), O_RDWR, 0);
|
||||
if (fd < 0) {
|
||||
std::string msg = "Open existing shared memory " + name +
|
||||
" failed: " + strerror(errno);
|
||||
throw SharedMemoryError(msg);
|
||||
}
|
||||
checkSize(fd);
|
||||
if (verifySize)
|
||||
checkSize(fd);
|
||||
shared_struct = mapSharedMemory(fd);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user