Fix a nasty bug with variable name shadowing
This commit is contained in:
parent
1bf25f0307
commit
11fdb8a4c7
2
halt.c
2
halt.c
@ -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");
|
||||||
}
|
}
|
||||||
|
@ -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");
|
||||||
}
|
}
|
||||||
|
@ -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");
|
||||||
}
|
}
|
||||||
|
@ -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");
|
||||||
}
|
}
|
||||||
|
@ -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");
|
||||||
}
|
}
|
||||||
|
2
reboot.c
2
reboot.c
@ -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");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user