mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-07-14 15:56:09 +02:00
add error log when opening dev/mem
This commit is contained in:
@@ -18,6 +18,7 @@ void HardwareMemoryModel::mapToMemory() {
|
||||
int fd = open("/dev/mem", O_RDWR | O_SYNC, 0);
|
||||
|
||||
if (fd == -1) {
|
||||
LOG(logERROR) << "Can't open /dev/mem: " << strerror(errno);
|
||||
throw std::runtime_error("Can't find /dev/mem");
|
||||
}
|
||||
|
||||
@@ -52,6 +53,9 @@ void HardwareMemoryModel::unmapMemory() {
|
||||
}
|
||||
}
|
||||
|
||||
HardwareMemoryModel::~HardwareMemoryModel() { unmapMemory(); }
|
||||
HardwareMemoryModel::~HardwareMemoryModel() {
|
||||
LOG(logDEBUG1) << "HardwareMemoryModel destructor called, unmapping memory";
|
||||
unmapMemory();
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
Reference in New Issue
Block a user