Fix a nasty bug with variable name shadowing

This commit is contained in:
Eric Andersen 2001-10-18 04:04:34 +00:00
parent 1bf25f0307
commit 11fdb8a4c7
6 changed files with 6 additions and 6 deletions

2
halt.c
View File

@ -30,7 +30,7 @@ extern int halt_main(int argc, char **argv)
/* don't assume init's pid == 1 */ /* don't assume init's pid == 1 */
pid_t *pid = find_pid_by_name("init"); pid_t *pid = find_pid_by_name("init");
if (!pid || *pid<=0) { if (!pid || *pid<=0) {
pid_t *pid = find_pid_by_name("linuxrc"); pid = find_pid_by_name("linuxrc");
if (!pid || *pid<=0) if (!pid || *pid<=0)
error_msg_and_die("no process killed"); error_msg_and_die("no process killed");
} }

View File

@ -30,7 +30,7 @@ extern int halt_main(int argc, char **argv)
/* don't assume init's pid == 1 */ /* don't assume init's pid == 1 */
pid_t *pid = find_pid_by_name("init"); pid_t *pid = find_pid_by_name("init");
if (!pid || *pid<=0) { if (!pid || *pid<=0) {
pid_t *pid = find_pid_by_name("linuxrc"); pid = find_pid_by_name("linuxrc");
if (!pid || *pid<=0) if (!pid || *pid<=0)
error_msg_and_die("no process killed"); error_msg_and_die("no process killed");
} }

View File

@ -30,7 +30,7 @@ extern int poweroff_main(int argc, char **argv)
/* don't assume init's pid == 1 */ /* don't assume init's pid == 1 */
pid_t *pid = find_pid_by_name("init"); pid_t *pid = find_pid_by_name("init");
if (!pid || *pid<=0) { if (!pid || *pid<=0) {
pid_t *pid = find_pid_by_name("linuxrc"); pid = find_pid_by_name("linuxrc");
if (!pid || *pid<=0) if (!pid || *pid<=0)
error_msg_and_die("no process killed"); error_msg_and_die("no process killed");
} }

View File

@ -30,7 +30,7 @@ extern int reboot_main(int argc, char **argv)
/* don't assume init's pid == 1 */ /* don't assume init's pid == 1 */
pid_t *pid = find_pid_by_name("init"); pid_t *pid = find_pid_by_name("init");
if (!pid || *pid<=0) { if (!pid || *pid<=0) {
pid_t *pid = find_pid_by_name("linuxrc"); pid = find_pid_by_name("linuxrc");
if (!pid || *pid<=0) if (!pid || *pid<=0)
error_msg_and_die("no process killed"); error_msg_and_die("no process killed");
} }

View File

@ -30,7 +30,7 @@ extern int poweroff_main(int argc, char **argv)
/* don't assume init's pid == 1 */ /* don't assume init's pid == 1 */
pid_t *pid = find_pid_by_name("init"); pid_t *pid = find_pid_by_name("init");
if (!pid || *pid<=0) { if (!pid || *pid<=0) {
pid_t *pid = find_pid_by_name("linuxrc"); pid = find_pid_by_name("linuxrc");
if (!pid || *pid<=0) if (!pid || *pid<=0)
error_msg_and_die("no process killed"); error_msg_and_die("no process killed");
} }

View File

@ -30,7 +30,7 @@ extern int reboot_main(int argc, char **argv)
/* don't assume init's pid == 1 */ /* don't assume init's pid == 1 */
pid_t *pid = find_pid_by_name("init"); pid_t *pid = find_pid_by_name("init");
if (!pid || *pid<=0) { if (!pid || *pid<=0) {
pid_t *pid = find_pid_by_name("linuxrc"); pid = find_pid_by_name("linuxrc");
if (!pid || *pid<=0) if (!pid || *pid<=0)
error_msg_and_die("no process killed"); error_msg_and_die("no process killed");
} }