X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=poweroff.c;h=bc8e67716f412e25f918055b78b193e8563af50f;hb=36fe1a30b1958351de2b8065cb19d3d1b8ed1b33;hp=7f9abf14a34daf566ce9dd93fd0eed9e1ebfb5cb;hpb=e49d5ecbbe51718fa925b6890a735e5937cc2aa2;p=oweals%2Fbusybox.git diff --git a/poweroff.c b/poweroff.c index 7f9abf14a..bc8e67716 100644 --- a/poweroff.c +++ b/poweroff.c @@ -26,6 +26,10 @@ extern int poweroff_main(int argc, char **argv) { +#ifdef BB_FEATURE_LINUXRC /* don't assume init's pid == 1 */ - exit(kill(findInitPid(), SIGUSR2)); + exit(kill(*(findPidByName("init")), SIGUSR2)); +#else + exit(kill(1, SIGUSR2)); +#endif }