starter: Avoid hiding global variable when checking PID file

This commit is contained in:
Tobias Brunner
2020-01-28 15:29:40 +01:00
parent cab86465bb
commit 42928551ab
+5 -5
View File
@@ -255,14 +255,14 @@ static void fatal_signal_handler(int signal)
abort();
}
static bool check_pid(char *pid_file)
static bool check_pid(char *file)
{
struct stat stb;
FILE *pidfile;
if (stat(pid_file, &stb) == 0)
if (stat(file, &stb) == 0)
{
pidfile = fopen(pid_file, "r");
pidfile = fopen(file, "r");
if (pidfile)
{
char buf[64];
@@ -279,8 +279,8 @@ static bool check_pid(char *pid_file)
return TRUE;
}
}
DBG1(DBG_APP, "removing pidfile '%s', process not running", pid_file);
unlink(pid_file);
DBG1(DBG_APP, "removing pidfile '%s', process not running", file);
unlink(file);
}
return FALSE;
}