summaryrefslogtreecommitdiff
path: root/init/init_shared.c
blob: 842942fe3443cb32cd0e3e73c84d33490e43b7a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
}