diff --git a/APIG/build/drde-cd b/APIG/build/drde-cd index a016164..4e094ec 100755 Binary files a/APIG/build/drde-cd and b/APIG/build/drde-cd differ diff --git a/APIG/client/ausreg-cd.cpp b/APIG/client/ausreg-cd.cpp index a08893e..00cd086 100644 --- a/APIG/client/ausreg-cd.cpp +++ b/APIG/client/ausreg-cd.cpp @@ -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()); diff --git a/APIG/client/commander.cpp b/APIG/client/commander.cpp index 4faab45..3e553b8 100644 --- a/APIG/client/commander.cpp +++ b/APIG/client/commander.cpp @@ -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; diff --git a/APIG/include/ausreg-cd.h b/APIG/include/ausreg-cd.h index a87a7c7..789155a 100644 --- a/APIG/include/ausreg-cd.h +++ b/APIG/include/ausreg-cd.h @@ -26,7 +26,6 @@ #include #include -#include #include #include