projects
/
openvswitch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7d97bab
)
daemon: Fix bogus error message in read_pidfile() when pidfile is empty.
author
Ben Pfaff
<blp@nicira.com>
Wed, 21 Jan 2009 00:33:52 +0000
(16:33 -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 a3b824e6a9ef4b048f88e2bbbea154e1b52fccef..38cbc7b2ed940a3dc2c762e0eb2d9d22191b1549 100644
(file)
--- a/
lib/daemon.c
+++ b/
lib/daemon.c
@@
-278,8
+278,13
@@
read_pidfile(const char *pidfile)
}
if (!fgets(line, sizeof line, file)) {
- error = errno;
- VLOG_WARN("%s: read: %s", pidfile, strerror(error));
+ if (ferror(file)) {
+ error = errno;
+ VLOG_WARN("%s: read: %s", pidfile, strerror(error));
+ } else {
+ error = ESRCH;
+ VLOG_WARN("%s: read: unexpected end of file", pidfile);
+ }
goto error;
}