From: Lennart Poettering Date: Wed, 23 Feb 2011 00:12:29 +0000 (+0100) Subject: ask-password: fix handling of timeouts when waiting for password X-Git-Tag: v19~29 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=7ded2e28f2a0e614a3981aeb5b74aaeadf6ad9db ask-password: fix handling of timeouts when waiting for password --- diff --git a/src/ask-password-api.c b/src/ask-password-api.c index cd663ae09..845517a69 100644 --- a/src/ask-password-api.c +++ b/src/ask-password-api.c @@ -111,7 +111,7 @@ int ask_password_tty( y = now(CLOCK_MONOTONIC); if (y > until) { - r = -ETIMEDOUT; + r = -ETIME; goto finish; } @@ -373,7 +373,7 @@ int ask_password_agent( goto finish; } - if ((k = poll(pollfd, _FD_MAX, until-t/USEC_PER_MSEC)) < 0) { + if ((k = poll(pollfd, _FD_MAX, (until-t)/USEC_PER_MSEC)) < 0) { if (errno == EINTR) continue;