From 11fdb8a4c79752157a8263fbcf583916d5ec0347 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 18 Oct 2001 04:04:34 +0000 Subject: [PATCH] Fix a nasty bug with variable name shadowing --- halt.c | 2 +- init/halt.c | 2 +- init/poweroff.c | 2 +- init/reboot.c | 2 +- poweroff.c | 2 +- reboot.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/halt.c b/halt.c index a6fec021b..d66e28d0e 100644 --- a/halt.c +++ b/halt.c @@ -30,7 +30,7 @@ extern int halt_main(int argc, char **argv) /* don't assume init's pid == 1 */ pid_t *pid = find_pid_by_name("init"); if (!pid || *pid<=0) { - pid_t *pid = find_pid_by_name("linuxrc"); + pid = find_pid_by_name("linuxrc"); if (!pid || *pid<=0) error_msg_and_die("no process killed"); } diff --git a/init/halt.c b/init/halt.c index a6fec021b..d66e28d0e 100644 --- a/init/halt.c +++ b/init/halt.c @@ -30,7 +30,7 @@ extern int halt_main(int argc, char **argv) /* don't assume init's pid == 1 */ pid_t *pid = find_pid_by_name("init"); if (!pid || *pid<=0) { - pid_t *pid = find_pid_by_name("linuxrc"); + pid = find_pid_by_name("linuxrc"); if (!pid || *pid<=0) error_msg_and_die("no process killed"); } diff --git a/init/poweroff.c b/init/poweroff.c index eba51342c..db20a4572 100644 --- a/init/poweroff.c +++ b/init/poweroff.c @@ -30,7 +30,7 @@ extern int poweroff_main(int argc, char **argv) /* don't assume init's pid == 1 */ pid_t *pid = find_pid_by_name("init"); if (!pid || *pid<=0) { - pid_t *pid = find_pid_by_name("linuxrc"); + pid = find_pid_by_name("linuxrc"); if (!pid || *pid<=0) error_msg_and_die("no process killed"); } diff --git a/init/reboot.c b/init/reboot.c index bdcd443eb..35afd74ff 100644 --- a/init/reboot.c +++ b/init/reboot.c @@ -30,7 +30,7 @@ extern int reboot_main(int argc, char **argv) /* don't assume init's pid == 1 */ pid_t *pid = find_pid_by_name("init"); if (!pid || *pid<=0) { - pid_t *pid = find_pid_by_name("linuxrc"); + pid = find_pid_by_name("linuxrc"); if (!pid || *pid<=0) error_msg_and_die("no process killed"); } diff --git a/poweroff.c b/poweroff.c index eba51342c..db20a4572 100644 --- a/poweroff.c +++ b/poweroff.c @@ -30,7 +30,7 @@ extern int poweroff_main(int argc, char **argv) /* don't assume init's pid == 1 */ pid_t *pid = find_pid_by_name("init"); if (!pid || *pid<=0) { - pid_t *pid = find_pid_by_name("linuxrc"); + pid = find_pid_by_name("linuxrc"); if (!pid || *pid<=0) error_msg_and_die("no process killed"); } diff --git a/reboot.c b/reboot.c index bdcd443eb..35afd74ff 100644 --- a/reboot.c +++ b/reboot.c @@ -30,7 +30,7 @@ extern int reboot_main(int argc, char **argv) /* don't assume init's pid == 1 */ pid_t *pid = find_pid_by_name("init"); if (!pid || *pid<=0) { - pid_t *pid = find_pid_by_name("linuxrc"); + pid = find_pid_by_name("linuxrc"); if (!pid || *pid<=0) error_msg_and_die("no process killed"); } -- 2.25.1