From 72a050c6201dfe8da57e2cd994973ed9f56b865e Mon Sep 17 00:00:00 2001 From: Zakarya Boudouar Date: Thu, 31 Oct 2019 22:31:28 +0000 Subject: [PATCH] =?UTF-8?q?=C3=9Cberpr=C3=BCfung=20ob=20speicher=20gut=20e?= =?UTF-8?q?rstellt=20wurde=20oder=20nicht?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SharedMemory.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/SharedMemory.cpp b/src/SharedMemory.cpp index fa0bc3c..6d26b61 100644 --- a/src/SharedMemory.cpp +++ b/src/SharedMemory.cpp @@ -5,6 +5,10 @@ //Shared-Memory-Segment erstellen oder öffnen – shmget() void shared_memory_init(){ memory_id = shmget(IPC_PRIVATE, SHMMAXSIZE, IPC_CREAT | IPC_EXCL); + if(memory_id<0){ + perror("Fehler bei der Erstellung des gemeinsamen Speicher"); + exit(1); + } } //Shared-Memory-Segment id weiterreichen @@ -29,8 +33,3 @@ void attach_process(void *myProcess){ void release_memory(){ int shmdt(void *myProcess); } - - - - -