Fixed segfault with 'cut -f 1 -d:' and added 'cut -s' suport.
[oweals/busybox.git] / halt.c
diff --git a/halt.c b/halt.c
index ecc6e8f3014afe5e06edac0bfc2aef920a60c5f1..2ca36d038eb1d653fe0e60a8548adece67e7ea1a 100644 (file)
--- a/halt.c
+++ b/halt.c
@@ -1,3 +1,4 @@
+/* vi: set sw=4 ts=4: */
 /*
  * Mini halt implementation for busybox
  *
 #include "internal.h"
 #include <signal.h>
 
-extern int
-halt_main(int argc, char ** argv)
+extern int halt_main(int argc, char **argv)
 {
-    exit( kill(1, SIGUSR1));
+#ifdef BB_FEATURE_LINUXRC
+       /* don't assume init's pid == 1 */
+       return(kill(*(findPidByName("init")), SIGUSR1));
+#else
+       return(kill(1, SIGUSR1));
+#endif
 }
-