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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user