summaryrefslogtreecommitdiffhomepage
path: root/init/init_shared.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_shared.c
parent0b0d393347a2f4444a49afa32491068ac92cbfa3 (diff)
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_shared.c')
-rw-r--r--init/init_shared.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/init/init_shared.c b/init/init_shared.c
new file mode 100644
index 000000000..842942fe3
--- /dev/null
+++ b/init/init_shared.c
@@ -0,0 +1,21 @@
+#include <signal.h>
+#include "busybox.h"
+
+#include "init_shared.h"
+
+
+extern int kill_init(int sig)
+{
+#ifdef CONFIG_FEATURE_INITRD
+ /* don't assume init's pid == 1 */
+ long *pid = find_pid_by_name("init");
+ if (!pid || *pid<=0) {
+ pid = find_pid_by_name("linuxrc");
+ if (!pid || *pid<=0)
+ bb_error_msg_and_die("no process killed");
+ }
+ return(kill(*pid, sig));
+#else
+ return(kill(1, sig));
+#endif
+}