ask-password-api: move tty_fd into AskPasswordRequest structure, too
This commit is contained in:
@@ -735,10 +735,11 @@ static int prompt_root_password(int rfd) {
|
||||
_cleanup_free_ char *error = NULL;
|
||||
|
||||
AskPasswordRequest req = {
|
||||
.tty_fd = -EBADF,
|
||||
.message = msg1,
|
||||
};
|
||||
|
||||
r = ask_password_tty(-EBADF, &req, /* until= */ 0, /* flags= */ 0, &a);
|
||||
r = ask_password_tty(&req, /* until= */ 0, /* flags= */ 0, &a);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to query root password: %m");
|
||||
if (strv_length(a) != 1)
|
||||
@@ -760,7 +761,7 @@ static int prompt_root_password(int rfd) {
|
||||
|
||||
req.message = msg2;
|
||||
|
||||
r = ask_password_tty(-EBADF, &req, /* until= */ 0, /* flags= */ 0, &b);
|
||||
r = ask_password_tty(&req, /* until= */ 0, /* flags= */ 0, &b);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to query root password: %m");
|
||||
if (strv_length(b) != 1)
|
||||
|
||||
Reference in New Issue
Block a user