]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
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 51a42a504cb9c00bc0c56f8aa907816856c3aa90..6c07393404051d1355f5f3170ca9be6fc6e2dcc4 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;
                        }