mirror of
https://github.com/systemd/systemd.git
synced 2025-02-04 21:47:31 +03:00
ask-password: derive pollfd array from enum
It's prettier that way!
This commit is contained in:
parent
c9eb4a0054
commit
088dcd8e41
@ -209,19 +209,21 @@ int ask_password_tty(
|
|||||||
const char *flag_file,
|
const char *flag_file,
|
||||||
char **ret) {
|
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 {
|
enum {
|
||||||
POLL_TTY,
|
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);
|
assert(ret);
|
||||||
|
|
||||||
if (flags & ASK_PASSWORD_NO_TTY)
|
if (flags & ASK_PASSWORD_NO_TTY)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user