mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-24 21:34:08 +03:00
ask-password: round up when determining sleep time
We should rather sleep to much than too little. This otherwise might result in a busy loop, because we slept too little and then recheck again coming to the conclusion we need to go to sleep again, and so on.
This commit is contained in:
parent
70dee4755a
commit
c9eb4a0054
@ -291,7 +291,7 @@ int ask_password_tty(
|
||||
goto finish;
|
||||
}
|
||||
|
||||
sleep_for = (int) ((until - y) / USEC_PER_MSEC);
|
||||
sleep_for = (int) DIV_ROUND_UP(until - y, USEC_PER_MSEC);
|
||||
}
|
||||
|
||||
if (flag_file)
|
||||
|
Loading…
Reference in New Issue
Block a user