X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=poweroff.c;h=007099d4d298e12696421fcb838b61a3cf99aa2f;hb=5165fbed639916e0fde15a827241b21981be7934;hp=7f9abf14a34daf566ce9dd93fd0eed9e1ebfb5cb;hpb=e49d5ecbbe51718fa925b6890a735e5937cc2aa2;p=oweals%2Fbusybox.git diff --git a/poweroff.c b/poweroff.c index 7f9abf14a..007099d4d 100644 --- a/poweroff.c +++ b/poweroff.c @@ -21,11 +21,15 @@ * */ -#include "internal.h" +#include "busybox.h" #include extern int poweroff_main(int argc, char **argv) { +#ifdef BB_FEATURE_LINUXRC /* don't assume init's pid == 1 */ - exit(kill(findInitPid(), SIGUSR2)); + return(kill(*(find_pid_by_name("init")), SIGUSR2)); +#else + return(kill(1, SIGUSR2)); +#endif }