aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>1999-12-09 22:39:55 +0000
committerEric Andersen <andersen@codepoet.org>1999-12-09 22:39:55 +0000
commit6805d5d69e9c2be264e62cf53c86ca3e5a929d31 (patch)
tree2ab43322a4fc33782d322ef029d33a46f3e8c5dd
parentf95ca97d1bb94307ee0b8ed95d329dc9d6ccec85 (diff)
downloadbusybox-w32-6805d5d69e9c2be264e62cf53c86ca3e5a929d31.tar.gz
busybox-w32-6805d5d69e9c2be264e62cf53c86ca3e5a929d31.tar.bz2
busybox-w32-6805d5d69e9c2be264e62cf53c86ca3e5a929d31.zip
Adjustments for Johns init stuff,
-Erik
-rw-r--r--halt.c3
-rw-r--r--init/halt.c3
-rw-r--r--init/reboot.c4
-rw-r--r--reboot.c4
-rw-r--r--utility.c9
5 files changed, 15 insertions, 8 deletions
diff --git a/halt.c b/halt.c
index ecc6e8f30..23eb23c30 100644
--- a/halt.c
+++ b/halt.c
@@ -26,6 +26,7 @@
26extern int 26extern int
27halt_main(int argc, char ** argv) 27halt_main(int argc, char ** argv)
28{ 28{
29 exit( kill(1, SIGUSR1)); 29 /* don't assume init's pid == 1 */
30 exit( kill(findInitPid(), SIGUSR1));
30} 31}
31 32
diff --git a/init/halt.c b/init/halt.c
index ecc6e8f30..23eb23c30 100644
--- a/init/halt.c
+++ b/init/halt.c
@@ -26,6 +26,7 @@
26extern int 26extern int
27halt_main(int argc, char ** argv) 27halt_main(int argc, char ** argv)
28{ 28{
29 exit( kill(1, SIGUSR1)); 29 /* don't assume init's pid == 1 */
30 exit( kill(findInitPid(), SIGUSR1));
30} 31}
31 32
diff --git a/init/reboot.c b/init/reboot.c
index 17ec9f82f..ff2c6ad18 100644
--- a/init/reboot.c
+++ b/init/reboot.c
@@ -26,6 +26,6 @@
26extern int 26extern int
27reboot_main(int argc, char ** argv) 27reboot_main(int argc, char ** argv)
28{ 28{
29 /* don't assume init's pid == 1 */ 29 /* don't assume init's pid == 1 */
30 exit( kill(findInitPid(), SIGUSR2)); 30 exit( kill(findInitPid(), SIGUSR2));
31} 31}
diff --git a/reboot.c b/reboot.c
index 17ec9f82f..ff2c6ad18 100644
--- a/reboot.c
+++ b/reboot.c
@@ -26,6 +26,6 @@
26extern int 26extern int
27reboot_main(int argc, char ** argv) 27reboot_main(int argc, char ** argv)
28{ 28{
29 /* don't assume init's pid == 1 */ 29 /* don't assume init's pid == 1 */
30 exit( kill(findInitPid(), SIGUSR2)); 30 exit( kill(findInitPid(), SIGUSR2));
31} 31}
diff --git a/utility.c b/utility.c
index 42ee00c50..74df632b9 100644
--- a/utility.c
+++ b/utility.c
@@ -1068,7 +1068,12 @@ extern long getNum (const char *cp)
1068} 1068}
1069#endif 1069#endif
1070 1070
1071#if 1 1071
1072#if defined BB_INIT || defined BB_HALT || defined BB_REBOOT
1073
1074#if ! defined BB_FEATURE_USE_PROCFS
1075#error Sorry, I depend on the /proc filesystem right now.
1076#endif
1072/* findInitPid() 1077/* findInitPid()
1073 * 1078 *
1074 * This finds the pid of init (which is not always 1). 1079 * This finds the pid of init (which is not always 1).
@@ -1095,7 +1100,7 @@ findInitPid()
1095 fgets(buffer, 256, status); 1100 fgets(buffer, 256, status);
1096 fclose(status); 1101 fclose(status);
1097 1102
1098 if ( (strcmp(&buffer[6], "init\n") == 0)) { 1103 if ( (strstr(buffer, "init\n") != NULL )) {
1099 return init_pid; 1104 return init_pid;
1100 } 1105 }
1101 } 1106 }