Merge branch 'refactor' of github.com:slsdetectorgroup/slsDetectorPackage into refactor

This commit is contained in:
Erik Frojdh 2019-03-18 12:06:49 +01:00
commit 43d478076c
2 changed files with 5 additions and 5 deletions

View File

@ -195,7 +195,7 @@ class SharedMemory {
/** /**
* Maximum length of name as from man pages * Maximum length of name as from man pages
*/ */
static const int name_max_length = 255; static const int NAME_MAX_LENGTH = 255;
/** /**
*Using the call operator to access the pointer *Using the call operator to access the pointer
@ -236,8 +236,8 @@ class SharedMemory {
ss << SHM_MULTI_PREFIX << multiId << SHM_SLS_PREFIX << slsId << sEnvPath; ss << SHM_MULTI_PREFIX << multiId << SHM_SLS_PREFIX << slsId << sEnvPath;
std::string temp = ss.str(); std::string temp = ss.str();
if (temp.length() > name_max_length) { if (temp.length() > NAME_MAX_LENGTH) {
std::string msg = "Shared memory initialization failed. " + temp + " has " + std::to_string(temp.length()) + " characters. \n" + "Maximum is " + std::to_string(name_max_length) + ". Change the environment variable " + SHM_ENV_NAME; std::string msg = "Shared memory initialization failed. " + temp + " has " + std::to_string(temp.length()) + " characters. \n" + "Maximum is " + std::to_string(NAME_MAX_LENGTH) + ". Change the environment variable " + SHM_ENV_NAME;
FILE_LOG(logERROR) << msg; FILE_LOG(logERROR) << msg;
throw SharedMemoryError(msg); throw SharedMemoryError(msg);
} }

View File

@ -426,7 +426,7 @@ int slsReceiverTCPIPInterface::set_port() {
} catch(SocketError &e) { } catch(SocketError &e) {
ret = FAIL; ret = FAIL;
// same socket, could not bind port // same socket, could not bind port
sprintf(mess, e.what()); sprintf(mess, "%s", e.what());
FILE_LOG(logERROR) << mess; FILE_LOG(logERROR) << mess;
} catch (...) { } catch (...) {
ret = FAIL; ret = FAIL;