This commit is contained in:
Erik Frojdh
2019-03-15 13:50:50 +01:00
parent 73af4a744f
commit c93b78c74f
5 changed files with 123 additions and 154 deletions

View File

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