summaryrefslogtreecommitdiffstats
path: root/src/tty-ask-password-agent
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-07-11 09:26:07 +0200
committerLennart Poettering <lennart@poettering.net>2024-07-19 11:41:43 +0200
commitcfac09083b287c713a2bc3724eb71468a350321d (patch)
tree33bd60ef8d5067f682092e02c9081c3ae49530ba /src/tty-ask-password-agent
parentterminal-util: add terminal_is_pty_fd() helper (diff)
downloadsystemd-cfac09083b287c713a2bc3724eb71468a350321d.tar.xz
systemd-cfac09083b287c713a2bc3724eb71468a350321d.zip
terminal-util: add new helper terminal_reset_defensive() that combines reset-by-ioctl and reset-by-sequence reasonably
Diffstat (limited to 'src/tty-ask-password-agent')
-rw-r--r--src/tty-ask-password-agent/tty-ask-password-agent.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c
index 84ce5e1940..b411c9c309 100644
--- a/src/tty-ask-password-agent/tty-ask-password-agent.c
+++ b/src/tty-ask-password-agent/tty-ask-password-agent.c
@@ -150,9 +150,7 @@ static int agent_ask_password_tty(
if (tty_fd < 0)
return log_error_errno(tty_fd, "Failed to acquire %s: %m", con);
- r = reset_terminal_fd(tty_fd, true);
- if (r < 0)
- log_warning_errno(r, "Failed to reset terminal, ignoring: %m");
+ (void) terminal_reset_defensive(tty_fd, /* switch_to_text= */ true);
log_info("Starting password query on %s.", con);
}