terminal-util: rework acquire_terminal()
authorLennart Poettering <lennart@poettering.net>
Tue, 13 Feb 2018 20:24:37 +0000 (21:24 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 13 Feb 2018 20:24:37 +0000 (21:24 +0100)
commit8854d7950449911dafc2aad945ad97584dd5b9f1
treece64ff32fb7eddae5c0e830571c2f11dc2bc6eb9
parent149bc84aacd06dccf2b0e4def6a2fa04fa902f2b
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.
src/basic/terminal-util.c
src/basic/terminal-util.h
src/core/execute.c
src/tty-ask-password-agent/tty-ask-password-agent.c