From: Martin Willi Date: Mon, 12 Mar 2018 06:26:06 +0000 (+0100) Subject: starter: Ignore an existing PID file if it references ourself X-Git-Tag: 5.6.3dr1~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b29590b705f31abe594fc1496f0a4be7e1f823c;p=thirdparty%2Fstrongswan.git starter: Ignore an existing PID file if it references ourself --- diff --git a/src/starter/starter.c b/src/starter/starter.c index 51a42a504c..6c07393404 100644 --- a/src/starter/starter.c +++ b/src/starter/starter.c @@ -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; }