summaryrefslogtreecommitdiff
path: root/src/tty-ask-password-agent
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-02-13 21:24:37 +0100
committerLennart Poettering <lennart@poettering.net>2018-02-13 21:24:37 +0100
commit8854d7950449911dafc2aad945ad97584dd5b9f1 (patch)
treece64ff32fb7eddae5c0e830571c2f11dc2bc6eb9 /src/tty-ask-password-agent
parent149bc84aacd06dccf2b0e4def6a2fa04fa902f2b (diff)
downloadsystemd-8854d7950449911dafc2aad945ad97584dd5b9f1.tar.gz
terminal-util: rework acquire_terminal()
This modernizes acquire_terminal() in a couple of ways: 1. The three boolean arguments are replaced by a flags parameter, that should be more descriptive in what it does. 2. We now properly handle inotify queue overruns 3. We use _cleanup_ for closing the fds now, to shorten the code quite a bit. Behaviour should not be altered by this.
Diffstat (limited to 'src/tty-ask-password-agent')
-rw-r--r--src/tty-ask-password-agent/tty-ask-password-agent.c2
1 files changed, 1 insertions, 1 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 baed728bf9..33b7e6010f 100644
--- a/src/tty-ask-password-agent/tty-ask-password-agent.c
+++ b/src/tty-ask-password-agent/tty-ask-password-agent.c
@@ -365,7 +365,7 @@ static int parse_password(const char *filename, char **wall) {
if (arg_console) {
const char *con = arg_device ?: "/dev/console";
- tty_fd = acquire_terminal(con, false, false, false, USEC_INFINITY);
+ tty_fd = acquire_terminal(con, ACQUIRE_TERMINAL_WAIT, USEC_INFINITY);
if (tty_fd < 0)
return log_error_errno(tty_fd, "Failed to acquire /dev/console: %m");