diff mbox series

ivshmem-server: Clean up shmem on shutdown

Message ID 3967fae7-0d95-6927-0a6a-b5ec90858ab4@web.de
State New
Headers show
Series ivshmem-server: Clean up shmem on shutdown | expand

Commit Message

Jan Kiszka Aug. 3, 2019, 11:47 a.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

So far, the server leaves the posix shared memory object behind when
terminating, requiring the user to explicitly remove it in order to
start a new instance.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 contrib/ivshmem-server/ivshmem-server.c | 1 +
 1 file changed, 1 insertion(+)

--
2.16.4
diff mbox series

Patch

diff --git a/contrib/ivshmem-server/ivshmem-server.c b/contrib/ivshmem-server/ivshmem-server.c
index 77f97b209c..9b9dbc87ec 100644
--- a/contrib/ivshmem-server/ivshmem-server.c
+++ b/contrib/ivshmem-server/ivshmem-server.c
@@ -370,6 +370,7 @@  ivshmem_server_close(IvshmemServer *server)
     }

     unlink(server->unix_sock_path);
+    shm_unlink(server->shm_path);
     close(server->sock_fd);
     close(server->shm_fd);
     server->sock_fd = -1;