Changed bb_regcomp to xregcomp and #if 0'ed out destroy_cmd_strs in sed.c
[oweals/busybox.git] / poweroff.c
index 405ca3fe2f7ea47c45400f1d8c3a048fb0dc3060..126a0fb9496e81fc08c8079127a7bc7a2714f0fb 100644 (file)
@@ -1,3 +1,4 @@
+/* vi: set sw=4 ts=4: */
 /*
  * Mini poweroff implementation for busybox
  *
 #include "internal.h"
 #include <signal.h>
 
-extern int
-poweroff_main(int argc, char ** argv)
+extern int poweroff_main(int argc, char **argv)
 {
-    /* don't assume init's pid == 1 */
-    exit( kill(findInitPid(), SIGUSR2));
+#ifdef BB_FEATURE_LINUXRC
+       /* don't assume init's pid == 1 */
+       return(kill(*(findPidByName("init")), SIGUSR2));
+#else
+       return(kill(1, SIGUSR2));
+#endif
 }