From: Ben Pfaff Date: Wed, 21 Jan 2009 00:34:11 +0000 (-0800) Subject: daemon: Fix behavior in read_pidfile() when pid file is not locked. X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=854e4ee087143f432412d9e0775fd15a7758307d;p=sliver-openvswitch.git daemon: Fix behavior in read_pidfile() when pid file is not locked. --- diff --git a/lib/daemon.c b/lib/daemon.c index 0a3af26ff..3b766b518 100644 --- a/lib/daemon.c +++ b/lib/daemon.c @@ -275,6 +275,11 @@ read_pidfile(const char *pidfile) VLOG_WARN("%s: fcntl: %s", pidfile, strerror(error)); goto error; } + if (lck.l_type == F_UNLCK) { + error = ESRCH; + VLOG_WARN("%s: pid file is not locked", pidfile); + goto error; + } if (!fgets(line, sizeof line, file)) { if (ferror(file)) {