Static-ify a variable. make du work with all the human-readable variants
[oweals/busybox.git] / poweroff.c
index 405ca3fe2f7ea47c45400f1d8c3a048fb0dc3060..007099d4d298e12696421fcb838b61a3cf99aa2f 100644 (file)
@@ -1,3 +1,4 @@
+/* vi: set sw=4 ts=4: */
 /*
  * Mini poweroff implementation for busybox
  *
  *
  */
 
-#include "internal.h"
+#include "busybox.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(*(find_pid_by_name("init")), SIGUSR2));
+#else
+       return(kill(1, SIGUSR2));
+#endif
 }