]> Zhao Yanbai Git Server - minix.git/commitdiff
Kill everyone even in tinyhalt. This causes tty to important clean up.
authorBen Gras <ben@minix3.org>
Mon, 10 Apr 2006 00:29:34 +0000 (00:29 +0000)
committerBen Gras <ben@minix3.org>
Mon, 10 Apr 2006 00:29:34 +0000 (00:29 +0000)
commands/reboot/tinyhalt.c

index 9ae91eba35750b6f410b52270d67f03b7fd8f006..80ce03f046549f4071178865f72d6f193d4ac02e 100755 (executable)
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <signal.h>
 
 int main(int argc, char **argv)
 {
@@ -27,7 +28,12 @@ int main(int argc, char **argv)
 
        if ((prog = strrchr(*argv,'/')) == nil) prog= argv[0]; else prog++;
 
-       sleep(2);       /* Not too fast. */
+       sleep(1);       /* Not too fast. */
+       signal(SIGHUP, SIG_IGN);
+       signal(SIGTERM, SIG_IGN);
+       kill(1, SIGTERM);
+       kill(-1, SIGTERM);
+       sleep(1);
 
        reboot(strcmp(prog, "reboot") == 0 ? RBT_MONITOR : RBT_HALT,
                reboot_code, strlen(reboot_code));