Improvements to connector shutdown code, attempted fix for Windows support.

This commit is contained in:
Thulinma 2015-04-16 13:18:52 +02:00
parent 2e052fa2a1
commit d120523bbb
2 changed files with 7 additions and 3 deletions

View file

@ -293,7 +293,7 @@ namespace IPC {
#ifdef __CYGWIN__
if (master) {
//Under cygwin, all pages are 4 bytes longer than claimed.
handle = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, len+4, name.c_str());
handle = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, len+4, std::string("Global\\" + name).c_str());
} else {
int i = 0;
do {

View file

@ -149,9 +149,13 @@ namespace Controller {
std::map<std::string, pid_t>::iterator it;
for (it = currentConnectors.begin(); it != currentConnectors.end(); it++){
if (!runningConns.count(it->first)){
if (Util::Procs::isActive(it->second)){
Log("CONF", "Stopping connector " + it->first);
Util::Procs::Stop(it->second);
}
currentConnectors.erase(it);
it = currentConnectors.begin();
}
}
//start up new/changed connectors