summaryrefslogtreecommitdiff
path: root/src/ask-password-api.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-04-13 21:42:46 +0200
committerLennart Poettering <lennart@poettering.net>2011-04-13 21:42:46 +0200
commit7dcda352a609d063098e238db09c03cdc25c564b (patch)
tree545a8c2f76af39cae406633c5bc181824ae076cc /src/ask-password-api.c
parentd55f4f3f92f56f76bdd06192d6a2ef3ee9fe4772 (diff)
ask-password: support passwords without timeouts
Diffstat (limited to 'src/ask-password-api.c')
-rw-r--r--src/ask-password-api.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ask-password-api.c b/src/ask-password-api.c
index 384cfc8f80..04d5623d9e 100644
--- a/src/ask-password-api.c
+++ b/src/ask-password-api.c
@@ -404,13 +404,13 @@ int ask_password_agent(
t = now(CLOCK_MONOTONIC);
- if (until <= t) {
+ if (until > 0 && until <= t) {
log_notice("Timed out");
r = -ETIME;
goto finish;
}
- if ((k = poll(pollfd, _FD_MAX, (until-t)/USEC_PER_MSEC)) < 0) {
+ if ((k = poll(pollfd, _FD_MAX, until > 0 ? (int) ((until-t)/USEC_PER_MSEC) : -1)) < 0) {
if (errno == EINTR)
continue;