summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-02-14 00:02:23 +0100
committerLennart Poettering <lennart@poettering.net>2018-02-14 00:03:05 +0100
commit088dcd8e41c589f1a180124370a90768a8bd521d (patch)
tree468f6e1e985329ef9168d2833e6bf3765c0225fa /src/shared
parentc9eb4a00542e9183a624190cef64d27c560254bd (diff)
downloadsystemd-088dcd8e41c589f1a180124370a90768a8bd521d.tar.gz
ask-password: derive pollfd array from enum
It's prettier that way!
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/ask-password-api.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c
index d727f5b142..8664513a89 100644
--- a/src/shared/ask-password-api.c
+++ b/src/shared/ask-password-api.c
@@ -209,18 +209,20 @@ int ask_password_tty(
const char *flag_file,
char **ret) {
+ enum {
+ POLL_TTY,
+ POLL_INOTIFY,
+ _POLL_MAX,
+ };
+
+ _cleanup_close_ int ttyfd = -1, notify = -1;
struct termios old_termios, new_termios;
char passphrase[LINE_MAX + 1] = {}, *x;
+ struct pollfd pollfd[_POLL_MAX];
size_t p = 0, codepoint = 0;
- int r;
- _cleanup_close_ int ttyfd = -1, notify = -1;
- struct pollfd pollfd[2];
bool reset_tty = false;
bool dirty = false;
- enum {
- POLL_TTY,
- POLL_INOTIFY
- };
+ int r;
assert(ret);