Fixed ERROR message when force-saving connector list to shared memory.

This commit is contained in:
Thulinma 2019-05-22 15:16:38 +02:00
parent 8d17d5f6c4
commit 42da518d5f
2 changed files with 11 additions and 5 deletions

View file

@ -23,12 +23,18 @@ namespace Controller {
static std::map<std::string, pid_t> currentConnectors; ///<The currently running connectors.
/// Updates the shared memory page with active connectors
void saveActiveConnectors(){
IPC::sharedPage f("MstCnns", 4096, true, false);
void saveActiveConnectors(bool forceOverride){
IPC::sharedPage f("MstCnns", 4096, forceOverride, false);
if (!f.mapped){
if (!forceOverride){
saveActiveConnectors(true);
return;
}
if (!f.mapped){
FAIL_MSG("Could not store connector data!");
return;
}
}
memset(f.mapped, 0, 32);
Util::RelAccX A(f.mapped, false);
A.addField("cmd", RAX_128STRING);

View file

@ -9,7 +9,7 @@ namespace Controller {
bool CheckProtocols(JSON::Value & p, const JSON::Value & capabilities);
/// Updates the shared memory page with active connectors
void saveActiveConnectors();
void saveActiveConnectors(bool forceOverride = false);
/// Reads active connectors from the shared memory pages
void loadActiveConnectors();