libc: fix expired-timer calculation

This commit is contained in:
Alexander Boettcher 2017-05-22 15:55:39 +02:00 committed by Christian Helmuth
parent c1edfa5d46
commit f865b71f27
1 changed files with 4 additions and 1 deletions

View File

@ -252,7 +252,10 @@ struct Libc::Timeout
{
unsigned long const now = _timer_accessor.timer().curr_time();
return _expired ? 0 : _absolute_timeout_ms - now;
if (_expired || _absolute_timeout_ms < now)
return 0;
return _absolute_timeout_ms - now;
}
};