mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
22 lines
402 B
C
22 lines
402 B
C
|
#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
|
||
|
}
|