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

index 7f01423..181c6fb 100644 (file)
@@ -193,7 +193,7 @@ static bool check_pidfile()
                        }
                        fclose(pidfile);
                        pidfile = NULL;
-                       if (pid && kill(pid, 0) == 0)
+                       if (pid && pid != getpid() && kill(pid, 0) == 0)
                        {
                                DBG1(DBG_DMN, "%s already running ('%s' exists)", dmn_name,
                                         pidfile_name);