Rename local variable shadowing variable in outer scope

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2020-02-28 14:36:14 +01:00
parent e72b61c9c9
commit 97ce0aa519
3 changed files with 9 additions and 9 deletions
+5 -5
View File
@@ -49,8 +49,8 @@ const char *condstr(enum cond_state s)
const char *cond_path(const char *name)
{
char tmp[MAX_ARG_LEN];
static char path[256];
char tmp[MAX_ARG_LEN];
snprintf(tmp, sizeof(tmp), COND_PATH "/%s", name);
@@ -59,8 +59,8 @@ const char *cond_path(const char *name)
unsigned int cond_get_gen(const char *file)
{
char *ptr, path[256];
unsigned int gen;
char *ptr, path[256];
FILE *fp;
int ret;
@@ -99,9 +99,9 @@ enum cond_state cond_get(const char *name)
enum cond_state cond_get_agg(const char *names)
{
char *cond;
enum cond_state s = COND_ON;
static char conds[MAX_COND_LEN];
enum cond_state s = COND_ON;
char *cond;
if (!names)
return COND_ON;
@@ -115,8 +115,8 @@ enum cond_state cond_get_agg(const char *names)
int cond_affects(const char *name, const char *names)
{
char *cond;
static char conds[MAX_COND_LEN];
char *cond;
if (!name || !names)
return 0;
+1 -1
View File
@@ -95,8 +95,8 @@ char *pid_get_name(pid_t pid, char *name, size_t len)
char *pid_file(svc_t *svc)
{
char fn[MAX_ARG_LEN];
static char path[256];
char fn[MAX_ARG_LEN];
if (svc->pidfile[0]) {
if (svc->pidfile[0] == '!')
+3 -3
View File
@@ -1351,10 +1351,10 @@ restart:
svc_set_state(svc, SVC_RUNNING_STATE);
/* Reassert condition if we go from waiting and no change */
if (!svc_is_changed(svc)) {
char cond[MAX_COND_LEN];
char name[MAX_COND_LEN];
mkcond(cond, sizeof(cond), svc->cmd);
cond_set_path(cond_path(cond), COND_ON);
mkcond(name, sizeof(name), svc->cmd);
cond_set_path(cond_path(name), COND_ON);
}
break;