mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
Steal controlling TTY on fallback console to enable job control.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -593,6 +593,11 @@ pid_t run_getty(char *cmd, char *args[], int console)
|
||||
|
||||
sig_unblock();
|
||||
|
||||
setsid();
|
||||
|
||||
if (ioctl(STDIN_FILENO, TIOCSCTTY, 1) < 0)
|
||||
_pe("Failed TIOCSCTTY");
|
||||
|
||||
while (!fexist(SYNC_SHUTDOWN)) {
|
||||
static const char msg[] = "\nPlease press Enter to activate this console.";
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ void tty_start(finit_tty_t *tty)
|
||||
#elif defined(GETTY_BUSYBOX)
|
||||
snprintf(line, sizeof(line), "%s %d %s %s", GETTY, tty->baud, tty->name, tty->term ?: "");
|
||||
#else
|
||||
strlcpy(line, FALLBACK_CONSOLE, sizeof(line));
|
||||
strlcpy(line, FALLBACK_SHELL, sizeof(line));
|
||||
#endif
|
||||
} else {
|
||||
strlcpy(line, tty->name, sizeof(line));
|
||||
|
||||
Reference in New Issue
Block a user