bugfix: initialize pid (as read from pidfile) to zero

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.
This commit is contained in:
Michael Tokarev 2009-05-18 16:28:55 +04:00 committed by Guus Sliepen
parent ec316aa32e
commit cdf7f13c31

View file

@ -37,7 +37,7 @@
pid_t read_pid (char *pidfile)
{
FILE *f;
long pid;
long pid = 0;
if (!(f=fopen(pidfile,"r")))
return 0;