aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-10-03 21:26:12 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-10-03 21:26:12 +0000
commitc695b430646b8c1b1df85ffa9bbaf14057811873 (patch)
treed5d5b8f9aec5eb15d45a43ea6a031dac4e05f39f /init
parentd815199e2e5b3bef043113758d8384cbe627d75f (diff)
downloadbusybox-w32-c695b430646b8c1b1df85ffa9bbaf14057811873.tar.gz
busybox-w32-c695b430646b8c1b1df85ffa9bbaf14057811873.tar.bz2
busybox-w32-c695b430646b8c1b1df85ffa9bbaf14057811873.zip
Look for either "init" or "linuxrc" processes
git-svn-id: svn://busybox.net/trunk/busybox@3476 69ca8d6d-28ef-0310-b511-8ec308f3f277
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)
29#ifdef BB_FEATURE_LINUXRC 29#ifdef BB_FEATURE_LINUXRC
30 /* don't assume init's pid == 1 */ 30 /* don't assume init's pid == 1 */
31 pid_t *pid = find_pid_by_name("init"); 31 pid_t *pid = find_pid_by_name("init");
32 if (!pid || *pid<=0) 32 if (!pid || *pid<=0) {
33 error_msg_and_die("no process killed"); 33 pid_t *pid = find_pid_by_name("linuxrc");
34 if (!pid || *pid<=0)
35 error_msg_and_die("no process killed");
36 }
34 return(kill(*pid, SIGUSR1)); 37 return(kill(*pid, SIGUSR1));
35#else 38#else
36 return(kill(1, SIGUSR1)); 39 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)
29#ifdef BB_FEATURE_LINUXRC 29#ifdef BB_FEATURE_LINUXRC
30 /* don't assume init's pid == 1 */ 30 /* don't assume init's pid == 1 */
31 pid_t *pid = find_pid_by_name("init"); 31 pid_t *pid = find_pid_by_name("init");
32 if (!pid || *pid<=0) 32 if (!pid || *pid<=0) {
33 error_msg_and_die("no process killed"); 33 pid_t *pid = find_pid_by_name("linuxrc");
34 if (!pid || *pid<=0)
35 error_msg_and_die("no process killed");
36 }
34 return(kill(*pid, SIGUSR2)); 37 return(kill(*pid, SIGUSR2));
35#else 38#else
36 return(kill(1, SIGUSR2)); 39 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)
29#ifdef BB_FEATURE_LINUXRC 29#ifdef BB_FEATURE_LINUXRC
30 /* don't assume init's pid == 1 */ 30 /* don't assume init's pid == 1 */
31 pid_t *pid = find_pid_by_name("init"); 31 pid_t *pid = find_pid_by_name("init");
32 if (!pid || *pid<=0) 32 if (!pid || *pid<=0) {
33 error_msg_and_die("no process killed"); 33 pid_t *pid = find_pid_by_name("linuxrc");
34 if (!pid || *pid<=0)
35 error_msg_and_die("no process killed");
36 }
34 return(kill(*pid, SIGTERM)); 37 return(kill(*pid, SIGTERM));
35#else 38#else
36 return(kill(1, SIGTERM)); 39 return(kill(1, SIGTERM));