diff options
-rw-r--r-- | init/init.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/init/init.c b/init/init.c index 1667d58cf..401cf693c 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -661,7 +661,7 @@ static void init_reboot(unsigned long magic) | |||
661 | { | 661 | { |
662 | pid_t pid; | 662 | pid_t pid; |
663 | /* We have to fork here, since the kernel calls do_exit(0) in | 663 | /* We have to fork here, since the kernel calls do_exit(0) in |
664 | * linux/kernel/sys.c, which can cause the machint to panic when | 664 | * linux/kernel/sys.c, which can cause the machine to panic when |
665 | * the init process is killed.... */ | 665 | * the init process is killed.... */ |
666 | if ((pid = fork()) == 0) { | 666 | if ((pid = fork()) == 0) { |
667 | #if (__GNU_LIBRARY__ > 5) || defined(__dietlibc__) | 667 | #if (__GNU_LIBRARY__ > 5) || defined(__dietlibc__) |
@@ -738,6 +738,22 @@ static void exec_signal(int sig) | |||
738 | sigaddset(&unblock_signals, SIGTSTP); | 738 | sigaddset(&unblock_signals, SIGTSTP); |
739 | sigprocmask(SIG_UNBLOCK, &unblock_signals, NULL); | 739 | sigprocmask(SIG_UNBLOCK, &unblock_signals, NULL); |
740 | 740 | ||
741 | /* Open the new terminal device */ | ||
742 | if ((device_open(a->terminal, O_RDWR)) < 0) { | ||
743 | if (stat(a->terminal, &sb) != 0) { | ||
744 | message(LOG | CONSOLE, "device '%s' does not exist.", a->terminal); | ||
745 | } else { | ||
746 | message(LOG | CONSOLE, "Bummer, can't open %s", a->terminal); | ||
747 | } | ||
748 | halt_signal(SIGUSR1); | ||
749 | } | ||
750 | |||
751 | /* Make sure the terminal will act fairly normal for us */ | ||
752 | set_term(0); | ||
753 | /* Setup stdout, stderr on the supplied terminal */ | ||
754 | dup(0); | ||
755 | dup(0); | ||
756 | |||
741 | messageD(CONSOLE | LOG, "Trying to re-exec %s", a->command); | 757 | messageD(CONSOLE | LOG, "Trying to re-exec %s", a->command); |
742 | execl(a->command, a->command, NULL); | 758 | execl(a->command, a->command, NULL); |
743 | 759 | ||