1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-03 17:47:28 +03:00

ask-password: derive pollfd array from enum

It's prettier that way!
This commit is contained in:
Lennart Poettering 2018-02-14 00:02:23 +01:00
parent c9eb4a0054
commit 088dcd8e41

View File

@ -209,19 +209,21 @@ int ask_password_tty(
const char *flag_file,
char **ret) {
struct termios old_termios, new_termios;
char passphrase[LINE_MAX + 1] = {}, *x;
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
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;
bool reset_tty = false;
bool dirty = false;
int r;
assert(ret);
if (flags & ASK_PASSWORD_NO_TTY)