From 70dee4755a573f538e8897f97dde868bc1741170 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 13 Feb 2018 23:57:40 +0100 Subject: [PATCH] ask-password: let's use structure initialization properly --- src/shared/ask-password-api.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c index 6f5a72dd46..fbe8d06c34 100644 --- a/src/shared/ask-password-api.c +++ b/src/shared/ask-password-api.c @@ -267,11 +267,14 @@ int ask_password_tty( reset_tty = true; } - zero(pollfd); - pollfd[POLL_TTY].fd = ttyfd >= 0 ? ttyfd : STDIN_FILENO; - pollfd[POLL_TTY].events = POLLIN; - pollfd[POLL_INOTIFY].fd = notify; - pollfd[POLL_INOTIFY].events = POLLIN; + pollfd[POLL_TTY] = (struct pollfd) { + .fd = ttyfd >= 0 ? ttyfd : STDIN_FILENO, + .events = POLLIN, + }; + pollfd[POLL_INOTIFY] = (struct pollfd) { + .fd = notify, + .events = POLLIN, + }; for (;;) { char c;