diff --git a/src/SharedMemory.cpp b/src/SharedMemory.cpp index d1b4b31..d1df9a0 100644 --- a/src/SharedMemory.cpp +++ b/src/SharedMemory.cpp @@ -7,9 +7,9 @@ int shared_memory_init(key_t key){ memory_id = shmget(key, SHMMAXSIZE, IPC_CREAT | 0666); - if(shmid == -1){ + if(memory_id == -1){ key++; - shmfnk(key); + shared_memory_init(key); return memory_id; } return 0;