mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 22:07:12 +02:00
Exception handling from constructors for slsDetector and multiSlsDetector, zmqsockets deleted first in multi freeshm/constructor, removed unnecessary exceptions from exceptions list, replaced in slsDetector socket assign from NULL to 0
This commit is contained in:
@ -61,6 +61,7 @@ void* SharedMemory::CreateSharedMemory(size_t sz){
|
||||
cprintf(RED, "Error: Create shared memory %s failed at ftruncate: %s\n",
|
||||
name.c_str(), strerror(errno));
|
||||
close(fd);
|
||||
RemoveSharedMemory();
|
||||
throw SharedMemoryException();
|
||||
}
|
||||
|
||||
@ -137,8 +138,10 @@ std::string SharedMemory::ConstructSharedMemoryName(int multiId, int slsId) {
|
||||
|
||||
std::string temp = ss.str();
|
||||
if (temp.length() > NAME_MAX) {
|
||||
cprintf(RED, "Error: Shared memory initialization %s failed: %s\n",
|
||||
name.c_str(), strerror(errno));
|
||||
cprintf(RED, "Error: Shared memory initialization failed. "
|
||||
"%s has %lu characters. \n"
|
||||
"Maximum is %d. Change the environment variable %s\n",
|
||||
temp.c_str(), temp.length(), NAME_MAX, SHM_ENV_NAME);
|
||||
throw SharedMemoryException();
|
||||
}
|
||||
return temp;
|
||||
|
Reference in New Issue
Block a user