starter: Avoid hiding global variable when checking PID file
This commit is contained in:
@@ -255,14 +255,14 @@ static void fatal_signal_handler(int signal)
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool check_pid(char *pid_file)
|
static bool check_pid(char *file)
|
||||||
{
|
{
|
||||||
struct stat stb;
|
struct stat stb;
|
||||||
FILE *pidfile;
|
FILE *pidfile;
|
||||||
|
|
||||||
if (stat(pid_file, &stb) == 0)
|
if (stat(file, &stb) == 0)
|
||||||
{
|
{
|
||||||
pidfile = fopen(pid_file, "r");
|
pidfile = fopen(file, "r");
|
||||||
if (pidfile)
|
if (pidfile)
|
||||||
{
|
{
|
||||||
char buf[64];
|
char buf[64];
|
||||||
@@ -279,8 +279,8 @@ static bool check_pid(char *pid_file)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DBG1(DBG_APP, "removing pidfile '%s', process not running", pid_file);
|
DBG1(DBG_APP, "removing pidfile '%s', process not running", file);
|
||||||
unlink(pid_file);
|
unlink(file);
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user