terminal-util: add helper for disabling terminal echo in termios struct

This commit is contained in:
Lennart Poettering
2023-12-21 19:15:01 +01:00
parent b0936baf11
commit d02d4f83f0
3 changed files with 12 additions and 4 deletions
+1 -3
View File
@@ -443,9 +443,7 @@ int ask_password_tty(
(void) loop_write(ttyfd, ANSI_NORMAL, SIZE_MAX);
new_termios = old_termios;
new_termios.c_lflag &= ~(ICANON|ECHO);
new_termios.c_cc[VMIN] = 1;
new_termios.c_cc[VTIME] = 0;
termios_disable_echo(&new_termios);
r = RET_NERRNO(tcsetattr(ttyfd, TCSADRAIN, &new_termios));
if (r < 0)