mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
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:
+2
-2
@@ -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
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user