diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-02-13 23:57:57 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-02-14 00:03:05 +0100 |
commit | c9eb4a00542e9183a624190cef64d27c560254bd (patch) | |
tree | dcc80480493055d86ff8230023d3980b1e5e9330 /src/shared/ask-password-api.c | |
parent | 70dee4755a573f538e8897f97dde868bc1741170 (diff) | |
download | systemd-c9eb4a00542e9183a624190cef64d27c560254bd.tar.gz |
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.
Diffstat (limited to 'src/shared/ask-password-api.c')
-rw-r--r-- | src/shared/ask-password-api.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c index fbe8d06c34..d727f5b142 100644 --- a/src/shared/ask-password-api.c +++ b/src/shared/ask-password-api.c @@ -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) |