projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
70dee47
)
ask-password: round up when determining sleep time
author
Lennart Poettering
<lennart@poettering.net>
Tue, 13 Feb 2018 22:57:57 +0000
(23:57 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 13 Feb 2018 23:03:05 +0000
(
00:03
+0100)
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.
src/shared/ask-password-api.c
patch
|
blob
|
history
diff --git
a/src/shared/ask-password-api.c
b/src/shared/ask-password-api.c
index fbe8d06c34d4035f9fd49b482c8c9e7adbbf3f34..d727f5b142d24caef923433606e035751ff2c65b 100644
(file)
--- 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)