aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-10-03 21:26:12 +0000
committerEric Andersen <andersen@codepoet.org>2001-10-03 21:26:12 +0000
commit371ca19f5346d626f0c75c8d53aa5e3fb2e85c43 (patch)
treed5d5b8f9aec5eb15d45a43ea6a031dac4e05f39f /init
parentf0a4ac82166dbaedeae1d5f92821b700fc8fa17f (diff)
downloadbusybox-371ca19f5346d626f0c75c8d53aa5e3fb2e85c43.tar.gz
Look for either "init" or "linuxrc" processes
Diffstat (limited to 'init')
-rw-r--r--init/halt.c7
-rw-r--r--init/poweroff.c7
-rw-r--r--init/reboot.c7
3 files changed, 15 insertions, 6 deletions
diff --git a/init/halt.c b/init/halt.c
index 10dcb4225..a6fec021b 100644
--- a/init/halt.c
+++ b/init/halt.c
@@ -29,8 +29,11 @@ extern int halt_main(int argc, char **argv)
#ifdef BB_FEATURE_LINUXRC
/* don't assume init's pid == 1 */
pid_t *pid = find_pid_by_name("init");
- if (!pid || *pid<=0)
- error_msg_and_die("no process killed");
+ if (!pid || *pid<=0) {
+ pid_t *pid = find_pid_by_name("linuxrc");
+ if (!pid || *pid<=0)
+ error_msg_and_die("no process killed");
+ }
return(kill(*pid, SIGUSR1));
#else
return(kill(1, SIGUSR1));
diff --git a/init/poweroff.c b/init/poweroff.c
index 8bb20e9bb..eba51342c 100644
--- a/init/poweroff.c
+++ b/init/poweroff.c
@@ -29,8 +29,11 @@ extern int poweroff_main(int argc, char **argv)
#ifdef BB_FEATURE_LINUXRC
/* don't assume init's pid == 1 */
pid_t *pid = find_pid_by_name("init");
- if (!pid || *pid<=0)
- error_msg_and_die("no process killed");
+ if (!pid || *pid<=0) {
+ pid_t *pid = find_pid_by_name("linuxrc");
+ if (!pid || *pid<=0)
+ error_msg_and_die("no process killed");
+ }
return(kill(*pid, SIGUSR2));
#else
return(kill(1, SIGUSR2));
diff --git a/init/reboot.c b/init/reboot.c
index 35c147b34..bdcd443eb 100644
--- a/init/reboot.c
+++ b/init/reboot.c
@@ -29,8 +29,11 @@ extern int reboot_main(int argc, char **argv)
#ifdef BB_FEATURE_LINUXRC
/* don't assume init's pid == 1 */
pid_t *pid = find_pid_by_name("init");
- if (!pid || *pid<=0)
- error_msg_and_die("no process killed");
+ if (!pid || *pid<=0) {
+ pid_t *pid = find_pid_by_name("linuxrc");
+ if (!pid || *pid<=0)
+ error_msg_and_die("no process killed");
+ }
return(kill(*pid, SIGTERM));
#else
return(kill(1, SIGTERM));