projects
/
openvswitch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2aada70
)
daemon: Fix behavior in read_pidfile() when pid file is not locked.
author
Ben Pfaff
<blp@nicira.com>
Wed, 21 Jan 2009 00:34:11 +0000
(16:34 -0800)
committer
Ben Pfaff
<blp@nicira.com>
Wed, 21 Jan 2009 00:44:14 +0000
(16:44 -0800)
lib/daemon.c
patch
|
blob
|
history
diff --git
a/lib/daemon.c
b/lib/daemon.c
index 38cbc7b2ed940a3dc2c762e0eb2d9d22191b1549..83465493912de40ba2130433fea4c2a7ff608854 100644
(file)
--- a/
lib/daemon.c
+++ b/
lib/daemon.c
@@
-276,6
+276,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)) {