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:
Lennart Poettering 2018-02-13 23:57:57 +01:00
parent 70dee4755a
commit c9eb4a0054

View file

@ -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)