getty: Remove TTY clear from built-in getty, delegate to run_getty()

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2017-09-01 05:47:53 +02:00
parent f273ecc135
commit 277c3dbb14
2 changed files with 5 additions and 8 deletions
+2 -2
View File
@@ -39,7 +39,7 @@
#define NUM_ARGS 16
int getty(char *tty, char *baud, char *term, int noclear, char *user);
int getty(char *tty, char *baud, char *term, char *user);
/* Wait for process completion, returns status of waitpid(2) syscall */
@@ -234,7 +234,7 @@ pid_t run_getty(char *tty, char *speed, char *term, int noclear, int console)
pid = fork();
if (!pid) {
prepare_tty(tty, "finit-getty", console);
_exit(getty(tty, speed, term, noclear, NULL));
_exit(getty(tty, speed, term, NULL));
}
return pid;
+3 -6
View File
@@ -64,7 +64,7 @@ static int readch(char *tty)
return ch1 & 0xFF;
}
static void stty(int fd, speed_t speed, int noclear)
static void stty(int fd, speed_t speed)
{
struct termios term;
@@ -99,9 +99,6 @@ static void stty(int fd, speed_t speed, int noclear)
term.c_cc[VKILL] = CTRL('U');
term.c_cc[VERASE] = CERASE;
tcsetattr(fd, TCSANOW, &term);
if (!noclear)
print("\e[r\e[H\e[J");
}
/*
@@ -300,7 +297,7 @@ static speed_t do_parse_speed(char *baud)
return B0;
}
int getty(char *tty, char *baud, char *term, int noclear, char *user)
int getty(char *tty, char *baud, char *term, char *user)
{
int fd;
char name[30];
@@ -341,7 +338,7 @@ int getty(char *tty, char *baud, char *term, int noclear, char *user)
sigaction(SIGQUIT, &sa, NULL);
/* Set up TTY */
stty(fd, speed, noclear);
stty(fd, speed);
close(fd);
utmp_set_login(tty, NULL);