starter: Ignore an existing PID file if it references ourself
authorMartin Willi <martin@strongswan.org>
Mon, 12 Mar 2018 06:26:06 +0000 (07:26 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 21 Mar 2018 09:25:49 +0000 (10:25 +0100)
src/starter/starter.c

index 51a42a5..6c07393 100644 (file)
@@ -276,7 +276,7 @@ static bool check_pid(char *pid_file)
                                pid = atoi(buf);
                        }
                        fclose(pidfile);
-                       if (pid && kill(pid, 0) == 0)
+                       if (pid && pid != getpid() && kill(pid, 0) == 0)
                        {       /* such a process is running */
                                return TRUE;
                        }