mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-06-10 03:26:09 +02:00
add error log when opening dev/mem
This commit is contained in:
@@ -80,6 +80,7 @@ int main(int argc, char *argv[]) {
|
||||
pause(); // wait for signal to exit
|
||||
}
|
||||
} catch (...) {
|
||||
LOG(logERROR) << "Some Error occured in Stop Server, exiting";
|
||||
kill(getppid(), SIGINT); // tell parent to exit // TODO: should then
|
||||
// also return EXIT_FAILURE
|
||||
}
|
||||
@@ -100,6 +101,7 @@ int main(int argc, char *argv[]) {
|
||||
pause(); // wait for signal to exit
|
||||
}
|
||||
} catch (...) {
|
||||
LOG(logERROR) << "Some Error occured in Control Server, exiting";
|
||||
LOG(sls::logINFOBLUE)
|
||||
<< "Exiting Control Server [ Tid: " << gettid() << " ]";
|
||||
LOG(sls::logINFO) << "Exiting Detector Server";
|
||||
|
||||
@@ -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