projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ec316aa
)
bugfix: initialize pid (as read from pidfile) to zero
author
Michael Tokarev
<mjt@corpit.ru>
Mon, 18 May 2009 12:28:55 +0000
(16:28 +0400)
committer
Guus Sliepen
<guus@sliepen.eu.org>
Mon, 18 May 2009 12:34:24 +0000
(14:34 +0200)
If we didn't read any number from a pid file, we'll return
an unitialized variable to the caller, and it will treat
that garbage as a pid of a process (possible to kill).
Fix that.
lib/pidfile.c
patch
|
blob
|
history
diff --git
a/lib/pidfile.c
b/lib/pidfile.c
index
830d3f3
..
426cbf3
100644
(file)
--- a/
lib/pidfile.c
+++ b/
lib/pidfile.c
@@
-37,7
+37,7
@@
pid_t read_pid (char *pidfile)
{
FILE *f;
- long pid;
+ long pid
= 0
;
if (!(f=fopen(pidfile,"r")))
return 0;