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 committed 2017-09-01 05:47:53 +02:00
1 parent f273ecc135
commit 277c3dbb14
2 files changed
+5 -8

No files matched your search

+2 -2
View File
@@ -39,7 +39,7 @@
#define NUM_ARGS 16 #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 */ /* 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(); pid = fork();
if (!pid) { if (!pid) {
prepare_tty(tty, "finit-getty", console); prepare_tty(tty, "finit-getty", console);
_exit(getty(tty, speed, term, noclear, NULL)); _exit(getty(tty, speed, term, NULL));
} }
return pid; return pid;
+3 -6
View File
@@ -64,7 +64,7 @@ static int readch(char *tty)
return ch1 & 0xFF; return ch1 & 0xFF;
} }
static void stty(int fd, speed_t speed, int noclear) static void stty(int fd, speed_t speed)
{ {
struct termios term; 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[VKILL] = CTRL('U');
term.c_cc[VERASE] = CERASE; term.c_cc[VERASE] = CERASE;
tcsetattr(fd, TCSANOW, &term); 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; 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; int fd;
char name[30]; char name[30];
@@ -341,7 +338,7 @@ int getty(char *tty, char *baud, char *term, int noclear, char *user)
sigaction(SIGQUIT, &sa, NULL); sigaction(SIGQUIT, &sa, NULL);
/* Set up TTY */ /* Set up TTY */
stty(fd, speed, noclear); stty(fd, speed);
close(fd); close(fd);
utmp_set_login(tty, NULL); utmp_set_login(tty, NULL);