mirror of
https://github.com/troglobit/finit.git
synced 2026-10-12 10:12:32 +00:00
Fix #84: Reset TTY w/ stty() before taking any pre-getty action
This patch moves the stty() function from getty.c to a separate file so it can be called from exec.c as well. The fix to #84 is simply to call stty() in prepare_tty(), which is shared by run_getty() and run_getty2() and called before "Please press Enter ...". Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
+7
-2
@@ -240,8 +240,13 @@ static void prepare_tty(char *tty, char *procname)
|
||||
struct termios term;
|
||||
|
||||
/*
|
||||
* Disable INTR, QUIT, SUSP, and DSUSP while handing over to
|
||||
* getty. It is up to the getty process to allow ISIG again.
|
||||
* Reset to sane defaults in case of messup from prev. session
|
||||
*/
|
||||
stty(STDIN_FILENO, B38400);
|
||||
|
||||
/*
|
||||
* Disable ISIG (INTR, QUIT, SUSP) before handing over to getty.
|
||||
* It is up to the getty process to allow them again.
|
||||
*/
|
||||
tcdrain(STDIN_FILENO);
|
||||
if (!tcgetattr(STDIN_FILENO, &term)) {
|
||||
|
||||
Reference in New Issue
Block a user