Add a way to unlink the semaphore
authorSamuel Dudik <redacted>
Sat, 15 Aug 2020 18:16:31 +0000 (20:16 +0200)
committerSamuel Dudik <redacted>
Sat, 15 Aug 2020 18:16:31 +0000 (20:16 +0200)
herbe.c

diff --git a/herbe.c b/herbe.c
index 270b9e973133a43cf06c4ef6d049c55a410f9ff2..ff449366e1747c28ec5a3237cd8fe1014de99a7b 100644 (file)
--- 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);