ask-password-api: move timeout into AskPasswordRequest structure too
This commit is contained in:
@@ -737,9 +737,10 @@ static int prompt_root_password(int rfd) {
|
||||
AskPasswordRequest req = {
|
||||
.tty_fd = -EBADF,
|
||||
.message = msg1,
|
||||
.until = USEC_INFINITY,
|
||||
};
|
||||
|
||||
r = ask_password_tty(&req, /* until= */ 0, /* flags= */ 0, &a);
|
||||
r = ask_password_tty(&req, /* flags= */ 0, &a);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to query root password: %m");
|
||||
if (strv_length(a) != 1)
|
||||
@@ -761,7 +762,7 @@ static int prompt_root_password(int rfd) {
|
||||
|
||||
req.message = msg2;
|
||||
|
||||
r = ask_password_tty(&req, /* until= */ 0, /* flags= */ 0, &b);
|
||||
r = ask_password_tty(&req, /* 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