From 615c28d7370dff1abe3b63a8e1477bf462bcd83b Mon Sep 17 00:00:00 2001 From: Samuel Dudik Date: Sat, 15 Aug 2020 20:16:31 +0200 Subject: [PATCH] Add a way to unlink the semaphore --- herbe.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/herbe.c b/herbe.c index 270b9e9..ff44936 100644 --- a/herbe.c +++ b/herbe.c @@ -86,7 +86,10 @@ void action() int main(int argc, char *argv[]) { if (argc == 1) + { + sem_unlink("/herbe"); die("Usage: %s body", argv[0]); + } signal(SIGALRM, expire); signal(SIGTERM, expire);