git://git.onelab.eu
/
sliver-openvswitch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0afaa45
)
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:45:22 +0000
(16:45 -0800)
lib/daemon.c
patch
|
blob
|
history
diff --git
a/lib/daemon.c
b/lib/daemon.c
index
0a3af26
..
3b766b5
100644
(file)
--- 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;
}
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)) {
if (!fgets(line, sizeof line, file)) {
if (ferror(file)) {