Kill everyone even in tinyhalt. This causes tty to important clean up.
This commit is contained in:
parent
9f3cc391a2
commit
f8b66e3d79
1 changed files with 7 additions and 1 deletions
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue