This commit is contained in:
Ren RenJuan 2014-01-17 17:26:02 +00:00
parent 421309132b
commit d67215b119
4 changed files with 14 additions and 11 deletions

Binary file not shown.

View File

@ -31,6 +31,15 @@ using namespace std;
using namespace boost::interprocess;
using namespace std;
//RAII constructor/destructor
struct shm_remove
{
shm_remove() { shared_memory_object::remove("ausreg-cd-global"); }
~shm_remove() { shared_memory_object::remove("ausreg-cd-global"); }
} remover;
shared_memory_object shm(create_only, "ausreg-cd-global", read_write);
void acClientServer() { // AKA "Cliever"
int i,lfp;
@ -120,14 +129,6 @@ int main(int const argc, const char ** const argv)
cdHasTk = strstr(argv[0],"loadtk") ? true : false;
cdOrTkValue = cdHasTk ? 'd' : 'D'; // d == EPP Toolkit enabled, D = !d
//RAII constructor/destructor
struct shm_remove
{
shm_remove() { shared_memory_object::remove("ausreg-cd-global"); }
~shm_remove() { shared_memory_object::remove("ausreg-cd-global"); }
} remover;
shared_memory_object shm(create_only, "ausreg-cd-global", read_write);
shm.truncate(CD_GLOBAL_SIZE);
mapped_region acCDglobal(shm, read_write);
memset(acCDglobal.get_address(), 0, acCDglobal.get_size());

View File

@ -12,6 +12,10 @@ int targetHost = 0;
mdDG mdg;
using namespace boost::interprocess;
extern shared_memory_object shm;
int is_numeric(const char *p) { int i = strlen(p),j=0;
if (*p) {
char c;
@ -237,8 +241,7 @@ void mdCommander::driver() {
thisConfig->terminateRequest = true;
sprintf(work,"kill -9 %d",thisConfig->daemonProcess);
system(work);
sprintf(work,"rm /dev/shm/ausreg-cd-global");
system(work);
shm.remove("ausreg-cd-global");
goto done;
}
continue;

View File

@ -26,7 +26,6 @@
#include <map>
#include <utility>
#include <map>
#include <string>
#include <queue>