aboutsummaryrefslogtreecommitdiff
path: root/init/init.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-06-27 17:08:15 +0000
committerEric Andersen <andersen@codepoet.org>2003-06-27 17:08:15 +0000
commitb01ed65ad2e46fc7747010b16e53b3a9e1a7c23a (patch)
tree2988261cdc1078ca34f71822d101aab5b482df43 /init/init.c
parent0b0d393347a2f4444a49afa32491068ac92cbfa3 (diff)
downloadbusybox-w32-b01ed65ad2e46fc7747010b16e53b3a9e1a7c23a.tar.gz
busybox-w32-b01ed65ad2e46fc7747010b16e53b3a9e1a7c23a.tar.bz2
busybox-w32-b01ed65ad2e46fc7747010b16e53b3a9e1a7c23a.zip
Apply last_patch93 from vodz:
andersen@busybox.net wrote: >Message: 4 >Modified Files: > init.c >Log Message: >Remove code for unsupported kernel versions Hmm. Current init.c have check >= 2.2.0 kernel one time too. Ok. Last patch removed this point and move common init code to new file for /init dir
Diffstat (limited to 'init/init.c')
-rw-r--r--init/init.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/init/init.c b/init/init.c
index d51d29156..1667d58cf 100644
--- a/init/init.c
+++ b/init/init.c
@@ -43,6 +43,10 @@
43#include <sys/types.h> 43#include <sys/types.h>
44#include <sys/wait.h> 44#include <sys/wait.h>
45#include "busybox.h" 45#include "busybox.h"
46
47#include "init_shared.h"
48
49
46#ifdef CONFIG_SYSLOGD 50#ifdef CONFIG_SYSLOGD
47# include <sys/syslog.h> 51# include <sys/syslog.h>
48#endif 52#endif
@@ -152,7 +156,6 @@ struct init_action {
152 156
153/* Static variables */ 157/* Static variables */
154static struct init_action *init_action_list = NULL; 158static struct init_action *init_action_list = NULL;
155static int kernelVersion;
156static char console[CONSOLE_BUFF_SIZE] = _PATH_CONSOLE; 159static char console[CONSOLE_BUFF_SIZE] = _PATH_CONSOLE;
157 160
158#ifndef CONFIG_SYSLOGD 161#ifndef CONFIG_SYSLOGD
@@ -764,7 +767,7 @@ static void halt_signal(int sig)
764 /* allow time for last message to reach serial console */ 767 /* allow time for last message to reach serial console */
765 sleep(2); 768 sleep(2);
766 769
767 if (sig == SIGUSR2 && kernelVersion >= KERNEL_VERSION(2, 2, 0)) 770 if (sig == SIGUSR2)
768 init_reboot(RB_POWER_OFF); 771 init_reboot(RB_POWER_OFF);
769 else 772 else
770 init_reboot(RB_HALT_SYSTEM); 773 init_reboot(RB_HALT_SYSTEM);
@@ -1014,15 +1017,7 @@ extern int init_main(int argc, char **argv)
1014 int status; 1017 int status;
1015 1018
1016 if (argc > 1 && !strcmp(argv[1], "-q")) { 1019 if (argc > 1 && !strcmp(argv[1], "-q")) {
1017 /* don't assume init's pid == 1 */ 1020 return kill_init(SIGHUP);
1018 long *pid = find_pid_by_name("init");
1019
1020 if (!pid || *pid <= 0) {
1021 pid = find_pid_by_name("linuxrc");
1022 if (!pid || *pid <= 0)
1023 bb_error_msg_and_die("no process killed");
1024 }
1025 return kill(*pid, SIGHUP);
1026 } 1021 }
1027#ifndef DEBUG_INIT 1022#ifndef DEBUG_INIT
1028 /* Expect to be invoked as init with PID=1 or be invoked as linuxrc */ 1023 /* Expect to be invoked as init with PID=1 or be invoked as linuxrc */
@@ -1049,9 +1044,6 @@ extern int init_main(int argc, char **argv)
1049 init_reboot(RB_DISABLE_CAD); 1044 init_reboot(RB_DISABLE_CAD);
1050#endif 1045#endif
1051 1046
1052 /* Figure out what kernel this is running */
1053 kernelVersion = get_kernel_revision();
1054
1055 /* Figure out where the default console should be */ 1047 /* Figure out where the default console should be */
1056 console_init(); 1048 console_init();
1057 1049