From 7bf9457f71910b6fc57f8fb2223ff94a590db552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= Date: Thu, 28 Apr 2016 02:22:53 -0300 Subject: [PATCH] pmap: Do not display error if shmctl(..IPC_RMID) returns EINVAL The segment may have been destroyed by the kernel automagically after shmdt(addr) How to reproduce: sysctl -w kernel.shm_rmid_forced=1 ./pmap 1 shared memory remove: Invalid argument [..] --- pmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmap.c b/pmap.c index 0ca95e9c..b2851c5e 100644 --- a/pmap.c +++ b/pmap.c @@ -201,7 +201,7 @@ static void discover_shm_minor(void) perror(_("shared memory detach")); out_destroy: - if (shmctl(shmid, IPC_RMID, NULL)) + if (shmctl(shmid, IPC_RMID, NULL) && errno != EINVAL) perror(_("shared memory remove")); return;