diff options
Diffstat (limited to 'init/init_shared.c')
-rw-r--r-- | init/init_shared.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/init/init_shared.c b/init/init_shared.c new file mode 100644 index 0000000..842942f --- /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 +} |