diff --git a/main/main.cpp b/main/main.cpp index 9a8548f..ef3064a 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -17,7 +17,7 @@ int main(int argc, char** argv) { vkvm::setDefaultValues(); std::atexit(deleteSharedMemory); std::string eingabe; - + getConfig(); while(eingabe != "exit") { std::cout << "cmd# "; std::cin >> eingabe; diff --git a/res/config.toml b/res/config.toml index e91e65f..e90cdab 100644 --- a/res/config.toml +++ b/res/config.toml @@ -1,5 +1,5 @@ #defaultKey = 12345 -newKey = 0 +#newKey = 0 layoutVersion = 0 width = 0 height = 0 diff --git a/src/SharedMemory.cpp b/src/SharedMemory.cpp index 2619e92..374d980 100644 --- a/src/SharedMemory.cpp +++ b/src/SharedMemory.cpp @@ -8,10 +8,11 @@ + key_t changedKey() { std::ofstream keyFile; - keyFile.open("key.log", std::ofstream::out | std::ofstream::trunc); + keyFile.open("/tmp/vkvmKey.log", std::ofstream::out | std::ofstream::trunc); keyFile.clear(); int newKey; std::cout << "Type in a new Key for the Shared Memory Segment" << std::endl; @@ -21,9 +22,6 @@ key_t changedKey() keyFile << newKey; keyFile.close(); - auto config = cpptoml::parse_file(configFile); - newKey = config->get_as("newKey").value_or(0); //toml - return key_t(newKey); } @@ -52,7 +50,7 @@ void initSharedMemory(void) { if(answer.compare("y") == 0) { vkvm::impl.sharedMemoryKey = changedKey(); - std::cout << "new Try with Key:c " << vkvm::impl.sharedMemoryKey << std::endl; + std::cout << "new Try with Key: " << vkvm::impl.sharedMemoryKey << std::endl; initSharedMemory(); } else if(answer.compare("n") == 0) { std::cout << "This will end shared memory" <