Fix a nasty bug with variable name shadowing
authorEric Andersen <andersen@codepoet.org>
Thu, 18 Oct 2001 04:04:34 +0000 (04:04 -0000)
committerEric Andersen <andersen@codepoet.org>
Thu, 18 Oct 2001 04:04:34 +0000 (04:04 -0000)
halt.c
init/halt.c
init/poweroff.c
init/reboot.c
poweroff.c
reboot.c

diff --git a/halt.c b/halt.c
index a6fec021bfe8230086dbf6108755496c0f96620c..d66e28d0e984eda6f60e6e61fcfe7d8be60757cb 100644 (file)
--- 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");
        }
index a6fec021bfe8230086dbf6108755496c0f96620c..d66e28d0e984eda6f60e6e61fcfe7d8be60757cb 100644 (file)
@@ -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");
        }
index eba51342cc62e3903722337c167e22ed46cfacd9..db20a45729fb77cece440a3c2cc24179db5607ab 100644 (file)
@@ -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");
        }
index bdcd443eb01aeb22b845170871bee74f8568b3ed..35afd74ffa2b8df7c5c4dce62e39c7514381d23c 100644 (file)
@@ -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");
        }
index eba51342cc62e3903722337c167e22ed46cfacd9..db20a45729fb77cece440a3c2cc24179db5607ab 100644 (file)
@@ -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");
        }
index bdcd443eb01aeb22b845170871bee74f8568b3ed..35afd74ffa2b8df7c5c4dce62e39c7514381d23c 100644 (file)
--- 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");
        }